AFActiveDirectoryProperties.SetAccount Method
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Set the account used to access Active Directory from the server.
Namespace: OSIsoft.AF
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public void SetAccount( string name, SecureString password )
Public Sub SetAccount ( name As String, password As SecureString ) Dim instance As AFActiveDirectoryProperties Dim name As String Dim password As SecureString instance.SetAccount(name, password)
public: void SetAccount( String^ name, SecureString^ password )
member SetAccount : name : string * password : SecureString -> unit
Parameters
- name
- Type: SystemString
The account name used to access Active Directory from the server. Specify to clear this setting so the account that the server is running under is used to access Active Directory. - password
- Type: System.SecuritySecureString
The account password for the account name used to access Active Directory from the server. If name is , then this parameter is ignored.
Remarks
Accessing the information in active directory is controlled by security.
This method sets the account that the server uses when accessing
Active Directory.
If not specified, then the account that the server is
running under is used. You only need to specify this property if the account
that the server is running under does not have access to Active Directory.
| If the ImpersonateUser property is set to , then this property setting is not used. |