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

AF SDK Reference

AFSecurity.GetSIDForAccountName Method (String)

  • Last UpdatedNov 18, 2025
  • 2 minute read
AFSecurity.GetSIDForAccountName Method (String)
Helper method that returns the security identifier (SID) for a windows account name.

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

Syntax

public static SecurityIdentifier GetSIDForAccountName(
	string accountName
)
Public Shared Function GetSIDForAccountName ( 
	accountName As String
) As SecurityIdentifier

Dim accountName As String
Dim returnValue As SecurityIdentifier

returnValue = AFSecurity.GetSIDForAccountName(accountName)
public:
static SecurityIdentifier^ GetSIDForAccountName(
	String^ accountName
)
static member GetSIDForAccountName : 
        accountName : string -> SecurityIdentifier 

Parameters

accountName
Type: SystemString
Windows account name (or SID in string form).

Return Value

Type: SecurityIdentifier
The SID associated with the account.

Remarks

If the account cannot be resolved, an exception will be thrown, typically, IdentityNotMappedException. If the account name is in the form of a security identifier (SID), it will be accepted.

Version Information

AFSDK


See Also

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