TestimoX

API Reference

Class

SidResolver

Namespace ADPlayground.Identity
Assembly ADPlayground
Modifiers static

Provides helper methods for resolving SIDs and distinguished names.

Inheritance

  • Object
  • SidResolver

Methods

public static String AccountNameToSidString(String accountName) #
Returns: String

Resolves an account name (SAM, UPN or distinguished name) to a SID string.

Parameters

accountName System.String requiredposition: 0
Account identity such as DOMAIN\\Name, Name@domain, or a DN.

Returns

SID string when resolution succeeds; otherwise null.

public static SecurityIdentifier DistinguishedNameToSid(String distinguishedName) #
Returns: SecurityIdentifier

Converts a distinguished name to a SecurityIdentifier.

Parameters

distinguishedName System.String requiredposition: 0
Object distinguished name.

Returns

SID or null when not found.

public static String DistinguishedNameToSidString(String distinguishedName) #
Returns: String

Converts a distinguished name to a SID string.

Parameters

distinguishedName System.String requiredposition: 0
Object distinguished name.
GetIdentityType 2 overloads
public static IdentityType GetIdentityType(SecurityIdentifier sid) #
Returns: IdentityType

Determines the directory object type for the specified SID.

Parameters

sid System.Security.Principal.SecurityIdentifier requiredposition: 0
SID value.

Returns

Resolved identity type.

public static IdentityType GetIdentityType(String sid) #
Returns: IdentityType

Determines the directory object type for the specified SID string.

Parameters

sid System.String requiredposition: 0
SID string.

Returns

Resolved identity type.

public static ValueTuple<Int32, Int32, TimeSpan> GetSidDnCacheStats() #
Returns: ValueTuple<Int32, Int32, TimeSpan>

Returns simple stats for the SID→DN cache (count, limit, TTL).

SidToAccountName 2 overloads
public static String SidToAccountName(SecurityIdentifier sid) #
Returns: String

Translates a SID to an NT account name.

Parameters

sid System.String requiredposition: 0
SID string.

Returns

Account name or null when translation fails.

SidToAccountName(System.Security.Principal.SecurityIdentifier sid) #

Translates a SID to an NT account name.

Parameters

sid System.Security.Principal.SecurityIdentifier required
SID value.
SidToDistinguishedName 3 overloads
public static String SidToDistinguishedName(SecurityIdentifier sid) #
Returns: String

Converts a SID to a distinguished name.

Parameters

sid System.String requiredposition: 0
SID string.

Returns

Distinguished name or null when not found.

public static String SidToDistinguishedName(String sid, String domainName) #
Returns: String

Attempts to resolve a SID to a DN using a healthy DC from the provided domain. Uses the bounded LDAP engine path instead of a serverless ADSI bind to avoid hanging on half‑dead controllers.

Parameters

sid System.String requiredposition: 0
SID string.
domainName System.String requiredposition: 1
DNS domain to target. When null, falls back to serverless bind.

Returns

Distinguished name or null if not found.

SidToDistinguishedName(System.Security.Principal.SecurityIdentifier sid) #

Converts a SID to a distinguished name.

Parameters

sid System.Security.Principal.SecurityIdentifier required
SID value.

Properties

public static Int32 SidDnCacheSizeLimit { get; set; } #

Maximum number of SID→DN cache entries to retain.

public static TimeSpan SidDnCacheTtl { get; set; } #

Time-to-live for SID→DN cache entries.