GroupPolicyExtension Constructor (DirectoryContext, String)
Initializes a new instance of the GroupPolicyExtension class by using the specified DirectoryContext and the display name of the Group Policy object (GPO).
Namespace: Microsoft.GroupPolicy
Assembly: Microsoft.GroupPolicy.Management (in Microsoft.GroupPolicy.Management.dll)
Syntax
protected GroupPolicyExtension(
DirectoryContext context,
string gpoDisplayName
)
protected:
GroupPolicyExtension(
DirectoryContext^ context,
String^ gpoDisplayName
)
new :
context:DirectoryContext *
gpoDisplayName:string -> GroupPolicyExtension
Protected Sub New (
context As DirectoryContext,
gpoDisplayName As String
)
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.
gpoDisplayName
Type: System.StringThe display name of the GPO to edit.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | context is null. |
ArgumentOutOfRangeException | context does not specify a directory context with a type of DirectoryServer or Domain. |
ActiveDirectoryObjectNotFoundException | The GPO is not found. -or- Cannot connect to the target specified in the context parameter. |
MultipleGroupPolicyObjectsFoundException | Multiple GPOs with the specified display name exist in the domain. |
See Also
GroupPolicyExtension Overload
GroupPolicyExtension Class
Microsoft.GroupPolicy Namespace
Return to top