API Reference
IdentityLookup
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 IdentityInfo Get(SecurityIdentifier sid, ConcurrentDictionary<String, IdentityInfo> localCache = null) #IdentityInfoResolves a SID string to IdentityInfo using the centralized cache and bounded directory lookup.
Parameters
- sidValue System.String
- SID string to resolve (e.g., S-1-5-32-544).
- localCache System.Collections.Concurrent.ConcurrentDictionary{System.String,ADPlayground.Identity.IdentityInfo} = null
- 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
- arg2 System.Collections.Concurrent.ConcurrentDictionary{System.String,ADPlayground.Identity.IdentityInfo}
public static IdentityInfo GetByIdentity(String identity, ConcurrentDictionary<String, IdentityInfo> localCache = null) #IdentityInfoResolves an arbitrary identity (SID/UPN/SAM/DN) using the centralized cache.
Parameters
- identity System.String
- localCache System.Collections.Concurrent.ConcurrentDictionary{System.String,ADPlayground.Identity.IdentityInfo} = null
public static String GetName(String sidValue) #StringReturns a friendly display name for the specified SID string.
Parameters
- sidValue System.String
- SID string (e.g., S-1-1-0).
Returns
Display name; never throws.
public static ValueTuple<String, IdentityInfo> GetNameAndInfo(SecurityIdentifier sid) #ValueTuple<String, IdentityInfo>Gets both display name and IdentityInfo for a SID string.
Parameters
- sidValue System.String
- 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
- SID.
Returns
Tuple containing Name and Info.