GroupPolicyObject.OpenDSGpo Method (DomainController, Guid, Boolean, Boolean)

 

Opens the Group Policy object (GPO) that has the specified GUID by using the specified domain controller.

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

Syntax

public void OpenDSGpo(
    DomainController domainController,
    Guid gpoId,
    bool readOnly,
    bool loadRegistry
)
public:
void OpenDSGpo(
    DomainController^ domainController,
    Guid gpoId,
    bool readOnly,
    bool loadRegistry
)
member OpenDSGpo : 
        domainController:DomainController *
        gpoId:Guid *
        readOnly:bool *
        loadRegistry:bool -> unit
Public Sub OpenDSGpo (
    domainController As DomainController,
    gpoId As Guid,
    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
ArgumentNullException

domainController is null.

ObjectDisposedException

The GroupPolicyObject is disposed.

ActiveDirectoryObjectNotFoundException

The GPO is not found.

Remarks

To create a new GPO in the Active Directory, you can call the one of the overloaded CreateNew methods.

See Also

OpenDSGpo Overload
GroupPolicyObject Class
Microsoft.GroupPolicy Namespace

Return to top