API Reference
Class
DuplicateSpnDetector
Detects duplicate Service Principal Names (SPNs) within a domain or forest.
Inheritance
- Object
- DuplicateSpnDetector
Remarks
See usage examples in the unit tests for typical scenarios.
Constructors
public DuplicateSpnDetector(Func<String, IEnumerable<ValueTuple<String, String, String>>> fetchSpns = null, Func<IEnumerable<String>> enumerateDomains = null) #Initializes a new instance of the DuplicateSpnDetector class.
Parameters
- fetchSpns System.Func{System.String,System.Collections.Generic.IEnumerable{System.ValueTuple{System.String,System.String,System.String}}} = null
- Delegate retrieving SPN data from a domain.
- enumerateDomains System.Func{System.Collections.Generic.IEnumerable{System.String}} = null
- Delegate returning domain names to process.
Methods
public Void CheckDomain(String domainName = null) #Returns:
VoidLogs a warning for each duplicate SPN in the given domain.
Parameters
- domainName System.String = null
- Domain to scan or null for current domain.
GetDuplicates 3 overloads
public IEnumerable<DuplicateSpnInfo> GetDuplicates(String domainName) #Returns:
IEnumerable<DuplicateSpnInfo>Finds duplicate SPNs in the specified domain.
Parameters
- domainName System.String
- Target domain name.
Returns
Collection of duplicate SPNs with affected objects.
public IEnumerable<DuplicateSpnInfo> GetDuplicates() #Returns:
IEnumerable<DuplicateSpnInfo>Finds duplicate SPNs across all domains in the forest.
Returns
Collection of duplicate SPNs with affected objects.
public IEnumerable<DuplicateSpnInfo> GetDuplicates(String domainName, IEnumerable<String> serviceClasses) #Returns:
IEnumerable<DuplicateSpnInfo>Finds duplicate SPNs with optional domain and service-class filtering.
Parameters
- domainName System.String
- Optional domain; when null, scans all forest domains.
- serviceClasses System.Collections.Generic.IEnumerable{System.String}
- Optional list of service classes (e.g., MSSQLSvc, HTTP).