GroupPolicyExtension.OpenGpo Method (Boolean, Boolean)

 

Opens the Group Policy object (GPO) according to the specified value for read only and optionally loads the registry.

Namespace:   Microsoft.GroupPolicy
Assembly:  Microsoft.GroupPolicy.Management (in Microsoft.GroupPolicy.Management.dll)

Syntax

protected void OpenGpo(
    bool readOnly,
    bool loadRegistry
)
protected:
void OpenGpo(
    bool readOnly,
    bool loadRegistry
)
member OpenGpo : 
        readOnly:bool *
        loadRegistry:bool -> unit
Protected Sub OpenGpo (
    readOnly As Boolean,
    loadRegistry As Boolean
)

Parameters

  • readOnly
    Type: System.Boolean

    true to open the GPO in read-only mode; otherwise, false.

  • loadRegistry
    Type: System.Boolean

    true to load the registry; otherwise, false.

Exceptions

Exception Condition
ActiveDirectoryObjectNotFoundException

An appropriate domain controller cannot be located.

ActiveDirectoryOperationException

A call to the underlying directory service caused an error.

InvalidOperationException

The GPO is already open.

ObjectDisposedException

The GroupPolicyExtension is disposed.

See Also

OpenGpo Overload
GroupPolicyExtension Class
Microsoft.GroupPolicy Namespace

Return to top