GroupPolicyObject Class

 

Provides methods to create and modify a GPO directly, without using the Group Policy Object Editor.

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

Inheritance Hierarchy

System.Object
  Microsoft.GroupPolicy.GroupPolicyObject

Syntax

public sealed class GroupPolicyObject : IDisposable
public ref class GroupPolicyObject sealed : IDisposable
[<Sealed>]
type GroupPolicyObject = 
    class
        interface IDisposable
    end
Public NotInheritable Class GroupPolicyObject
    Implements IDisposable

Constructors

Name Description
System_CAPS_pubmethod GroupPolicyObject()

Initializes a new instance of the GroupPolicyObject class.

Properties

Name Description
System_CAPS_pubproperty DisplayName

Gets or sets the display name for the Group Policy object (GPO).

System_CAPS_pubproperty GpoType

Gets the type for the Group Policy object (GPO).

System_CAPS_pubproperty IsComputerEnabled

Gets or sets a value that specifies whether the computer portion of the Group Policy object (GPO) is enabled.

System_CAPS_pubproperty IsUserEnabled

Gets or sets a value that specifies whether the user portion of the Group Policy object (GPO) is enabled.

System_CAPS_pubproperty Name

Gets the (unique) name of the Group Policy object (GPO).

System_CAPS_pubproperty Path

Gets the path to the Group Policy object (GPO).

Methods

Name Description
System_CAPS_pubmethod CreateNew(Domain, String, Boolean, Boolean)

Creates a new Group Policy object (GPO) with the specified display name in the specified domain.

System_CAPS_pubmethod CreateNew(String, String, Boolean, Boolean)

Creates a new Group Policy object (GPO) with the specified display name by using the Active Directory path to a domain or a domain controller.

System_CAPS_pubmethod Delete()

Deletes the Group Policy object (GPO) represented by this GroupPolicyObject.

System_CAPS_pubmethod DeleteAllValues(RegistryHive, String)

Deletes the registry-based policy settings for a registry key and all its values from the Group Policy object (GPO).

System_CAPS_pubmethod DeleteValue(RegistryHive, String, String)

Deletes the registry-based policy setting for a registry value from the Group Policy object (GPO).

System_CAPS_pubmethod Dispose()

Releases all resources used by the current instance of the GroupPolicyObject.

System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_pubmethod GetDSPath(GpoSection)

Retrieves the Active Directory path to the root of the specified Group Policy object (GPO) section.

System_CAPS_pubmethod GetFileSystemPath(GpoSection)

Retrieves the file system path to the root of the specified Group Policy object (GPO) section. The path is in UNC format.

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetRegistrySetting(RegistryHive, String, String)

Retrieves the registry-based policy setting for the specified registry value from the Group Policy object (GPO).

System_CAPS_pubmethod GetRegistrySettings(RegistryHive, String)

Retrieves the registry-based policy settings for a registry key and all its values from the Group Policy object (GPO).

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_pubmethod OpenDSGpo(Domain, Guid, Boolean, Boolean)

Opens the Group Policy object (GPO) that has the specified GUID by using the domain specified by the Domain object.

System_CAPS_pubmethod OpenDSGpo(DomainController, Guid, Boolean, Boolean)

Opens the Group Policy object (GPO) that has the specified GUID by using the specified domain controller.

System_CAPS_pubmethod OpenDSGpo(String, Boolean, Boolean)

Opens the Group Policy object (GPO) that has the specified path.

System_CAPS_pubmethod Save(Boolean, Boolean, Guid, Guid)

Saves the specified registry-based policy settings to disk and updates the revision number of the GPO.

System_CAPS_pubmethod SetRegistrySetting(PolicyRegistrySetting)

Sets a new registry-based policy setting in the Group Policy object (GPO) based on the specified PolicyRegistrySetting.

System_CAPS_pubmethod ToString()

(Inherited from Object.)

Thread Safety

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Microsoft.GroupPolicy Namespace

Return to top