Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Use a multiexcerptinclude for Subkey


Method

RegistryEnumerateKeys

ModuleNativeServices
LibraryCore
Action


Excerpt
Enumerate the subkeys under a registry hive & key.


Parameters

Multiexcerpt include
MultiExcerptNameHiveParameter
PageWithExcerptMethod Notes

Subkey (string): The registry key to look for within the hive.

Multiexcerpt include
MultiExcerptNameSubkeyParameter
PageWithExcerptMethod Notes

Recursive (boolean; optional, default false): Whether to descend recursively or not.

Return values

If Hive does not exist then the result is InvalidParameter and this string:

    • Invalid registry hive name: <Hive>

If Subkey has invalid structure then the result is ExecutionError and this string:

    • Invalid syntax

If SubKey exists but cannot be opened by the agent (for any reason) then it is treated as though it does not exist.

If Subkey does not exist then the result is SuccessNoContent.

Otherwise the results issued will have these columns for each subkey found:

    • Name (string): The full path of the a (sub)key found below the Subkey parameter supplied

    • DefaultValue (string): The string value assigned to the (sub)key if set (the value named "(Default)" in RegEdit), or "(value not set)" if not (like RegEdit).

Example


Code Block
languageperl
 NativeServices.RegistryEnumerateKeys(Hive:"HKLM", Subkey:"software\\vendor", Recursive:true);


Platforms
  • Windows
Notes

The supplied key will appear in the results if it exists, regardless of whether or not it has child keys.

There is a limit of 8192 subkeys being returned (plus the key itself, if it exists). This is currently not changeable.