AFSecurity.GetSIDForAccountName Method (String)
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
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: SecurityIdentifierThe 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.