AFSecurity.GetAccountNameForSID Method (SecurityIdentifier, Boolean)
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Helper method to return the Windows Account name for a security identifier (SID).
Namespace: OSIsoft.AF
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public static string GetAccountNameForSID( SecurityIdentifier sid, bool invariant )
Public Shared Function GetAccountNameForSID ( sid As SecurityIdentifier, invariant As Boolean ) As String Dim sid As SecurityIdentifier Dim invariant As Boolean Dim returnValue As String returnValue = AFSecurity.GetAccountNameForSID(sid, invariant)
public: static String^ GetAccountNameForSID( SecurityIdentifier^ sid, bool invariant )
static member GetAccountNameForSID : sid : SecurityIdentifier * invariant : bool -> string
Parameters
- sid
- Type: System.Security.PrincipalSecurityIdentifier
The security identifier (SID) to convert to an account name. - invariant
- Type: SystemBoolean
If , the invariant name of the built-in accounts will be returned.
Return Value
Type: StringThe account name associated with the SID. If no account name is found, the SID is returned in string form.