RegistryPolicy.Read Method (RegistryHive, String)
Reads all the registry-based policy settings that configure first-level values under the specified registry key.
Namespace: Microsoft.GroupPolicy
Assembly: Microsoft.GroupPolicy.Management (in Microsoft.GroupPolicy.Management.dll)
Syntax
public ReadOnlyCollection<RegistryItem> Read(
RegistryHive hive,
string keyPath
)
public:
ReadOnlyCollection<RegistryItem^>^ Read(
RegistryHive hive,
String^ keyPath
)
member Read :
hive:RegistryHive *
keyPath:string -> ReadOnlyCollection<RegistryItem>
Public Function Read (
hive As RegistryHive,
keyPath As String
) As ReadOnlyCollection(Of RegistryItem)
Parameters
hive
Type: Microsoft.Win32.RegistryHiveOne of the RegistryHive values that specifies the registry hive of the key. Specify CurrentUser to read policy settings from User Configuration. Specify LocalMachine to read policy settings from Computer Configuration. No other values are supported.
keyPath
Type: System.StringThe path to the registry key.
Return Value
Type: System.Collections.ObjectModel.ReadOnlyCollection<RegistryItem>
Returns ReadOnlyCollection<T>. A read-only collection of RegistryItem objects that contains the registry-based policy settings.
Exceptions
Exception | Condition |
---|---|
ObjectDisposedException | The RegistryPolicy is disposed. |
ArgumentNullException | keyPath is null |
ArgumentException | keyPath is an empty string (“”) -or- hive is not CurrentUser or LocalMachine. |
See Also
Read Overload
RegistryPolicy Class
Microsoft.GroupPolicy Namespace
Return to top