API Reference
Class
GpoOwnershipService
Gets and sets GPO owner information (groupPolicyContainer security descriptor owner).
Inheritance
- Object
- GpoOwnershipService
Methods
public static GpoOwnerInfo GetOwner(String domainName, Guid gpoId) #Returns:
GpoOwnerInfoReads the owner of a GPO AD object.
Parameters
- domainName System.String
- DNS domain name where the GPO resides.
- gpoId System.Guid
- GPO GUID (groupPolicyContainer objectGuid).
Returns
Ownership information, including owner SID and friendly display name when resolvable.
public static GpoOwnerInfo SetOwner(String domainName, Guid gpoId, String identity) #Returns:
GpoOwnerInfoSets the owner of a GPO AD object to the specified identity (name or SID).
Parameters
- domainName System.String
- DNS domain name where the GPO resides.
- gpoId System.Guid
- GPO GUID (groupPolicyContainer objectGuid).
- identity System.String
- New owner identity (SID, SAM, UPN, or DN).
Returns
Ownership information after applying the change (best-effort).