GroupPolicyExtension Constructor (DirectoryContext, Guid)
Initializes a new instance of the GroupPolicyExtension class by using the specified DirectoryContext and the specified Group Policy object (GPO) ID (GUID).
Namespace: Microsoft.GroupPolicy
Assembly: Microsoft.GroupPolicy.Management (in Microsoft.GroupPolicy.Management.dll)
Syntax
protected GroupPolicyExtension(
DirectoryContext context,
Guid gpoId
)
protected:
GroupPolicyExtension(
DirectoryContext^ context,
Guid gpoId
)
new :
context:DirectoryContext *
gpoId:Guid -> GroupPolicyExtension
Protected Sub New (
context As DirectoryContext,
gpoId As Guid
)
Parameters
context
Type: System.DirectoryServices.ActiveDirectory.DirectoryContextA 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
Type: System.GuidThe GUID of the GPO to edit.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | context is null. |
ArgumentOutOfRangeException | context does not specify a directory context with a type of DirectoryServeror Domain. |
ActiveDirectoryObjectNotFoundException | The GPO is not found. -or- Cannot connect to the target specified in the context parameter. |
See Also
GroupPolicyExtension Overload
GroupPolicyExtension Class
Microsoft.GroupPolicy Namespace
Return to top