PreferenceExtension Constructor (DirectoryContext, Guid, Boolean)

 

Initializes a new instance of the PreferenceExtension class by using the specified DirectoryContext, the specified Group Policy object (GPO) ID (GUID), and a value that specifies whether to edit Computer Configuration or User Configuration.

Namespace:   Microsoft.GroupPolicy
Assembly:  Microsoft.GroupPolicy.Management (in Microsoft.GroupPolicy.Management.dll)

Syntax

protected PreferenceExtension(
    DirectoryContext context,
    Guid gpoId,
    bool isComputerConfiguration
)
protected:
PreferenceExtension(
    DirectoryContext^ context,
    Guid gpoId,
    bool isComputerConfiguration
)
new : 
        context:DirectoryContext *
        gpoId:Guid *
        isComputerConfiguration:bool -> PreferenceExtension
Protected Sub New (
    context As DirectoryContext,
    gpoId As Guid,
    isComputerConfiguration As Boolean
)

Parameters

  • isComputerConfiguration
    Type: System.Boolean

    true to edit Computer Configuration; false to edit User Configuration.

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.

See Also

PreferenceExtension Overload
PreferenceExtension Class
Microsoft.GroupPolicy Namespace

Return to top