TestimoX

API Reference

Class

IdentityLookup

Namespace ADPlayground.Identity
Assembly ADPlayground
Modifiers static

Central identity lookup with a global, size/TTL-bounded cache and a safe, fast resolver path. Use this instead of ad-hoc code: IdentityLookup.Get(sid), IdentityLookup.GetName(sid), IdentityLookup.GetNameAndInfo(sid).

Inheritance

  • Object
  • IdentityLookup

Remarks

Behavior: GC-first, single-result directory query within IdentityResolution.DefaultTimeoutMs; if not found within budget, falls back to cached translation; adds results to a process-wide cache honoring IdentityResolution.IdentityCacheMaxEntries and IdentityCacheTtl; never throws to callers; always returns an with filled.

Methods

public static Void ClearCache() #
Returns: Void

Clears the global identity cache.

Get 2 overloads
public static IdentityInfo Get(SecurityIdentifier sid, ConcurrentDictionary<String, IdentityInfo> localCache = null) #
Returns: IdentityInfo

Resolves a SID string to IdentityInfo using the centralized cache and bounded directory lookup.

Parameters

sidValue System.String requiredposition: 0
SID string to resolve (e.g., S-1-5-32-544).
localCache System.Collections.Concurrent.ConcurrentDictionary{System.String,ADPlayground.Identity.IdentityInfo} = null optionalposition: 1
Optional per-call cache to reuse within a single mapping operation.

Returns

Resolved IdentityInfo (never null).

Get(System.Security.Principal.SecurityIdentifier arg1, System.Collections.Concurrent.ConcurrentDictionary{System.String,ADPlayground.Identity.IdentityInfo} arg2) #

Resolves a SecurityIdentifier to IdentityInfo using the centralized cache.

Parameters

arg1 System.Security.Principal.SecurityIdentifier required
arg2 System.Collections.Concurrent.ConcurrentDictionary{System.String,ADPlayground.Identity.IdentityInfo} required
public static IdentityInfo GetByIdentity(String identity, ConcurrentDictionary<String, IdentityInfo> localCache = null) #
Returns: IdentityInfo

Resolves an arbitrary identity (SID/UPN/SAM/DN) using the centralized cache.

Parameters

identity System.String requiredposition: 0
localCache System.Collections.Concurrent.ConcurrentDictionary{System.String,ADPlayground.Identity.IdentityInfo} = null optionalposition: 1
public static String GetName(String sidValue) #
Returns: String

Returns a friendly display name for the specified SID string.

Parameters

sidValue System.String requiredposition: 0
SID string (e.g., S-1-1-0).

Returns

Display name; never throws.

GetNameAndInfo 2 overloads
public static ValueTuple<String, IdentityInfo> GetNameAndInfo(SecurityIdentifier sid) #
Returns: ValueTuple<String, IdentityInfo>

Gets both display name and IdentityInfo for a SID string.

Parameters

sidValue System.String requiredposition: 0
SID string.

Returns

Tuple containing Name and Info.

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

Gets both display name and IdentityInfo for a SecurityIdentifier.

Parameters

sid System.Security.Principal.SecurityIdentifier required
SID.

Returns

Tuple containing Name and Info.