GroupPolicyObject.OpenDSGpo Method (String, Boolean, Boolean)
Opens the Group Policy object (GPO) that has the specified path.
Namespace: Microsoft.GroupPolicy
Assembly: Microsoft.GroupPolicy.Management.Interop (in Microsoft.GroupPolicy.Management.Interop.dll)
Syntax
public void OpenDSGpo(
string gpoPath,
bool readOnly,
bool loadRegistry
)
public:
void OpenDSGpo(
String^ gpoPath,
bool readOnly,
bool loadRegistry
)
member OpenDSGpo :
gpoPath:string *
readOnly:bool *
loadRegistry:bool -> unit
Public Sub OpenDSGpo (
gpoPath As String,
readOnly As Boolean,
loadRegistry As Boolean
)
Parameters
gpoPath
Type: System.StringThe path to the GPO in ADSI format.
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 |
---|---|
ArgumentException | gpoPath is an empty string (“”). |
ArgumentNullException | gpoPath is null. |
ObjectDisposedException | The GroupPolicyObject is disposed. |
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