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, String)

AFSecurity.GetAccountNameForSID Method (SecurityIdentifier, Boolean, String)

  • Last UpdatedNov 18, 2025
  • 2 minute read
AFSecurity.GetAccountNameForSID Method (SecurityIdentifier, Boolean, String)
Helper method to return the Windows Account name for a security identifier (SID) on a remote machine.

Namespace:  OSIsoft.AF
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public static string GetAccountNameForSID(
	SecurityIdentifier sid,
	bool invariant,
	string machineName
)
Public Shared Function GetAccountNameForSID ( 
	sid As SecurityIdentifier,
	invariant As Boolean,
	machineName As String
) As String

Dim sid As SecurityIdentifier
Dim invariant As Boolean
Dim machineName As String
Dim returnValue As String

returnValue = AFSecurity.GetAccountNameForSID(sid, 
	invariant, machineName)
public:
static String^ GetAccountNameForSID(
	SecurityIdentifier^ sid, 
	bool invariant, 
	String^ machineName
)
static member GetAccountNameForSID : 
        sid : SecurityIdentifier * 
        invariant : bool * 
        machineName : string -> 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.
machineName
Type: SystemString
The name of the remote machine to be used as the context for resolving the sid. To use the local machine, specify .

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

Supported in: 3.1.1, 3.1.0, 3.0.2, 3.0.1, 3.0.0, 2.10.11, 2.10.5, 2.10.0, 2.10, 2.9.5, 2.9, 2.8.5, 2.8, 2.7.5, 2.7

See Also

In This Topic
TitleResults for “How to create a CRG?”Also Available in