API Reference
Class
GpoLinkCleaner
Provides methods to locate and optionally remove GPO links pointing to nonexistent GPOs.
Inheritance
- Object
- GpoLinkCleaner
Methods
ExtractGuids(System.String gplink) #Extracts all GPO GUIDs from the provided gPLink value.
Parameters
- gplink System.String
- Raw gPLink string.
Returns
GUIDs found in the value.
public static IEnumerable<GpoLinkInfo> GetOrphanedLinks(String domainName = null) #Returns:
IEnumerable<GpoLinkInfo>Retrieves GPO links that reference nonexistent GPOs.
Parameters
- domainName System.String = null
- Target domain name or null for the current domain.
Returns
Enumeration of orphaned links.
public static Task<List<GpoLinkInfo>> GetOrphanedLinksAsync(String domainName = null) #Returns:
Task<List<GpoLinkInfo>>Asynchronously retrieves GPO links that reference nonexistent GPOs.
Parameters
- domainName System.String = null
- Target domain name or null for the current domain.
Returns
List of orphaned links.
public static Void RemoveOrphanedLinks(IEnumerable<GpoLinkInfo> links) #Returns:
VoidRemoves the specified GPO links.
Parameters
- links System.Collections.Generic.IEnumerable{ADPlayground.Gpo.GpoLinkInfo}
- Links to remove.
public static Task RemoveOrphanedLinksAsync(IEnumerable<GpoLinkInfo> links) #Returns:
TaskAsynchronously removes the specified GPO links.
Parameters
- links System.Collections.Generic.IEnumerable{ADPlayground.Gpo.GpoLinkInfo}
- Links to remove.