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

  • valueName
    Type: System.String

    The 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