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

AF SDK Reference

AFSecurity.GetUserId Method

  • Last UpdatedNov 18, 2025
  • 2 minute read
AFSecurity.GetUserId Method
Get the user identifier for the specified user name.

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

Syntax

public static int GetUserId(
	PISystem system,
	string userName
)
Public Shared Function GetUserId ( 
	system As PISystem,
	userName As String
) As Integer

Dim system As PISystem
Dim userName As String
Dim returnValue As Integer

returnValue = AFSecurity.GetUserId(system, 
	userName)
public:
static int GetUserId(
	PISystem^ system, 
	String^ userName
)
static member GetUserId : 
        system : PISystem * 
        userName : string -> int 

Parameters

system
Type: OSIsoft.AFPISystem
The user identifier The PISystem being used to evaluate the user name.
userName
Type: SystemString
The name of the requested user identifier to be returned.

Return Value

Type: Int32
Returns the user identifier for the requested user name within the specified system.

Remarks

Each PISystem maintains a list of known users with a unique identifier used within that server. This method will return the user identifier for a user name within the specified PISystem. This can be used to specify the SecurityOwnerId when creating an AFSecurityRightsToken.

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

See Also

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