Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Opens the Group Policy object (GPO) that has the specified GUID by using the domain specified by the Domain object.
Namespace: Microsoft.GroupPolicy
Assembly: Microsoft.GroupPolicy.Management.Interop (in Microsoft.GroupPolicy.Management.Interop.dll)
Syntax
public void OpenDSGpo(
Domain domain,
Guid gpoId,
bool readOnly,
bool loadRegistry
)
public:
void OpenDSGpo(
Domain^ domain,
Guid gpoId,
bool readOnly,
bool loadRegistry
)
member OpenDSGpo :
domain:Domain *
gpoId:Guid *
readOnly:bool *
loadRegistry:bool -> unit
Public Sub OpenDSGpo (
domain As Domain,
gpoId As Guid,
readOnly As Boolean,
loadRegistry As Boolean
)
Parameters
domain
Type: System.DirectoryServices.ActiveDirectory.DomainA Domain object that represents the domain in which the GPO exists. The system selects a domain controller to use.
gpoId
Type: System.GuidA Guid that contains the ID of the GPO.
readOnly
Type: System.Booleantrue to open the GPO in read-only mode; otherwise, false.
loadRegistry
Type: System.Booleantrue to load the registry; otherwise, false.
Exceptions
| Exception | Condition |
|---|---|
| ArgumentNullException | domain 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