GroupPolicyObject.GetDSPath Method (GpoSection)


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

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


public string GetDSPath(
    GpoSection section
String^ GetDSPath(
    GpoSection section
member GetDSPath : 
        section:GpoSection -> string
Public Function GetDSPath (
    section As GpoSection
) As String


Return Value

Type: System.String

Returns String. The path in ADSI format (LDAP://cn=user, ou=users, dc=coname, dc=com).


Exception Condition

The GroupPolicyObject is disposed.


If you call the GetDSPath method and specify a computer GPO, the method returns an empty string (“”). This is because computer GPOs do not have Active Directory storage; they have only file system storage.

To retrieve the file system path to the root of a GPO section, you can call the GetFileSystemPath method.

See Also

GroupPolicyObject Class
Microsoft.GroupPolicy Namespace

Return to top