Changes the password on a connector space object to a new password. This method requires that you enable password synchronization for the management agent. To use this method, the value that is used for the OldPassword parameter must match the stored password.

string ChangePassword( [in] string OldPassword,
 [in] string NewPassword


In Language Name Data Type Description




Contains the old password. This value must match the stored password.




Contains the new password.

Name : ChangePassword

Return Value


Returns a string that contains the results of the method. The return value can be one of the following values or one of the values listed in WMI Provider Return Strings.

Name Description


The call was successful and the password was changed to the NewPassword parameter.


The specified OldPassword parameter does not match the password for the account. Verify that you are using the correct password for this parameter.


The management agent was unable to log on to the connected directory using the stored credentials. Verify that the management agent credentials are correct. For more information, see “Connect to an Active Directory Forest” in the Microsoft Forefront Identity Manager 2010 (FIM) Help.


The management agent did not set the password because 128-bit encryption is not configured on the connection that is used by the management agent to communicate with the connected directory. Enable this encryption on your network.


The management agent does not support password changes.


The management agent does not support password changes on this object type.


The specified NewPassword parameter does not comply with the password policy that was set by the administrator. Verify that the NewPassword parameter complies with the password policy that was set by the administrator.


The specified NewPassword parameter cannot be used as a password because the parameter contains characters that cannot be entered from a keyboard. Verify that the NewPassword parameter contains only characters that can be entered from a keyboard.


The object was provisioned as a new object, but the object was not created in the connected directory. You cannot perform password operations until the object is exported to the connected directory.


The object was deleted from the server.


The password synchronization setting for the specified management agent is not enabled. Enable password synchronization for the specified management agent.


The specified object is in a partition that has not yet been configured. Configure the partition with the Synchronization Service Manager. For more information, see “Configure directory partitions” in the FIM Help.


The FIM Synchronization Service server could not connect to the server that contains the partition for the object. Verify that the server that contains the partition is running and is connected to the network.


The new password cannot be set because the time that is indicated on the Microsoft Identity Integration server is more than five minutes from the time that is indicated on the Active Directory Domain Services (AD DS) server. By default, the time difference between servers must be less than or equal to five minutes. Synchronize the times between the servers.


This method works only with the following management agents:

  • Management agent for Active Directory Domain Services

  • Management agent for Active Directory Application Mode (ADAM)

  • Management agent for AD DS global address list (GAL)

  • Management agent for Windows NT 4.0

  • Novell eDirectory

  • IBM DS

When you call this method, an entry is written to the event log. The entry contains information about the user who made the request, the target of the request, and the status of the request.


The following example shows how you can use Microsoft Visual Basic Script (VBScript) to change the password of all objects with a specified domain and User Principal Name.

Visual Basic Script  Copy Code
Option Explicit

On Error Resume Next

Dim Service
Dim CsObjects
Dim CsObject

Set Service = GetObject("winmgmts:root\MicrosoftIdentityIntegrationServer")
Set CsObjects = Service.ExecQuery("Select * from MIIS_CSObject where domain='main' and userPrincipalName='Jeff'")

For each CsObject in CsObjects
   WScript.Echo "ChangePassword returns " & CsObject.ChangePassword("OldPassword", "NewPassword")

Sub ErrorHandler (ErrorMessage)
  WScript.Echo ErrorMessage
End Sub



Forefront Identity Manager Synchronization Service 2010



See Also