PIIdentity.SetPassword Method
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Set the password associated with this PIUser identity.
Namespace: OSIsoft.AF.PI
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public void SetPassword( SecureString newPassword, SecureString oldPassword = null )
Public Sub SetPassword ( newPassword As SecureString, Optional oldPassword As SecureString = Nothing ) Dim instance As PIIdentity Dim newPassword As SecureString Dim oldPassword As SecureString instance.SetPassword(newPassword, oldPassword)
public: void SetPassword( SecureString^ newPassword, SecureString^ oldPassword = nullptr )
member SetPassword : newPassword : SecureString * ?oldPassword : SecureString (* Defaults: let _oldPassword = defaultArg oldPassword null *) -> unit
Parameters
- newPassword
- Type: System.SecuritySecureString
The new password to set. If then the password associated with this PIUser identity will be removed. - oldPassword (Optional)
- Type: System.SecuritySecureString
The old password to replace. The default value is , which means that no password is currently assigned to the PIUser identity.
Remarks
This method is only valid for an identity type of PIUser.
This method should only be called if IsDirty is , i.e. not impending changes to the PIIdentity object.