RegistryPolicy Constructor (DirectoryContext, Guid, Boolean)

Initializes a new instance of the RegistryPolicy class by using the specified DirectoryContext, the specified Group Policy object (GPO) ID (GUID), and a value that specifies whether to open the GPO in read-only mode.

Namespace: Microsoft.GroupPolicy
Assembly: Microsoft.GroupPolicy.Management (in microsoft.grouppolicy.management.dll)

Usage

    Dim context As DirectoryContext
Dim gpoId As Guid
Dim readOnly As Boolean

Dim instance As New RegistryPolicy(context, gpoId, readOnly)

Syntax

'Declaration
Public Sub New ( _
    context As DirectoryContext, _
    gpoId As Guid, _
    readOnly As Boolean _
)
public RegistryPolicy (
    DirectoryContext context,
    Guid gpoId,
    bool readOnly
)
public:
RegistryPolicy (
    DirectoryContext^ context, 
    Guid gpoId, 
    bool readOnly
)
public RegistryPolicy (
    DirectoryContext context, 
    Guid gpoId, 
    boolean readOnly
)
public function RegistryPolicy (
    context : DirectoryContext, 
    gpoId : Guid, 
    readOnly : boolean
)

Parameters

  • context
    A DirectoryContext that identifies the context with which the directory is accessed. This includes the directory, the domain, and the credentials that are used to access the directory.
  • gpoId
    The GUID of the GPO to edit.
  • readOnly
    true to open the GPO in read-only mode; otherwise, false.

Remarks

This constructor calls the GroupPolicyExtension(DirectoryContext,Guid) constructor and OpenGpo(Boolean,Boolean) methods. Exceptions thrown from those methods will be passed back to the caller of this constructor.

Platforms

Development Platforms

Windows Server 2008 R2

Target Platforms

Windows Server 2008 R2

See Also

Reference

RegistryPolicy Class
RegistryPolicy Members
Microsoft.GroupPolicy Namespace