RegistryPolicy.Read Method (RegistryHive, String, String)
Reads the registry-based policy setting that configures a specified registry value.
Namespace: Microsoft.GroupPolicy
Assembly: Microsoft.GroupPolicy.Management (in Microsoft.GroupPolicy.Management.dll)
Syntax
public ReadOnlyCollection<RegistryItem> Read(
RegistryHive hive,
string keyPath,
string valueName
)
public:
ReadOnlyCollection<RegistryItem^>^ Read(
RegistryHive hive,
String^ keyPath,
String^ valueName
)
member Read :
hive:RegistryHive *
keyPath:string *
valueName:string -> ReadOnlyCollection<RegistryItem>
Public Function Read (
hive As RegistryHive,
keyPath As String,
valueName 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.
valueName
Type: System.StringThe name of the registry value. You can specify an empty string (“”) for the default value.
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. |
InvalidOperationException | The RegistryPolicy instance is read-only. |
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