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)

Usage

    Dim context As DirectoryContext
Dim gpoDisplayName As String

Dim instance As New GroupPolicyExtension(context, gpoDisplayName)

Syntax

'Declaration
Protected Sub New ( _
    context As DirectoryContext, _
    gpoDisplayName As String _
)
protected GroupPolicyExtension (
    DirectoryContext context,
    string gpoDisplayName
)
protected:
GroupPolicyExtension (
    DirectoryContext^ context, 
    String^ gpoDisplayName
)
protected GroupPolicyExtension (
    DirectoryContext context, 
    String gpoDisplayName
)
protected function GroupPolicyExtension (
    context : DirectoryContext, 
    gpoDisplayName : String
)

Parameters

  • context
    A 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
    The display name of the GPO to edit.

Exceptions

Exception type 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.

Platforms

Development Platforms

Windows Server 2008 R2

Target Platforms

Windows Server 2008 R2

See Also

Reference

GroupPolicyExtension Class
GroupPolicyExtension Members
Microsoft.GroupPolicy Namespace