Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

AFSecurity.GetAccountNameForSID Method (SecurityIdentifier, Boolean)

AFSecurity.GetAccountNameForSID Method (SecurityIdentifier, Boolean)

  • Last UpdatedJan 12, 2026
  • 2 minute read
AFSecurity.GetAccountNameForSID Method (SecurityIdentifier, Boolean)
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.2.0.7

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: String
The account name associated with the SID. If no account name is found, the SID is returned in string form.

Version Information

AFSDK


See Also

In This Topic