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

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