Using PowerShell scripts with password synchronization
Optionally, you can configure the Synchronization Service to run your custom PowerShell script before, after, or instead of the password synchronization operation. To do so, create a connection handler. For instructions, see Using connection handlers.
Example of a PowerShell script run after password synchronization
#---- Specify the SMTP Server name in your organization ----
$SmtpServer = "smtpServerName"
$smtp = new-object system.net.mail.smtpClient($SmtpServer)
$mail = new-object System.Net.Mail.MailMessage
# ---- Set the sender mail ----
$mail.From = "email@example.com"
# ---- Set the destination mail ----
# --- Specify the message subject ----
$mail.Subject = "Password was changed"
# ---- Set the message text ----
$body = "The passwords were synchronized for the following object pair: "
$body = $body + $srcObj.Name + "->" + $dstObj.Name
$mail.Body = $body
# ---- Send mail ----
Description: After the password synchronization is complete, this script sends a notification email message informing the administrator that the specified object password has been modified in the target connected system. The message provides the names of the source Active Directory object and its counterpart in the target connected system.
About synchronization history
Synchronization Service Administration Console provides the Synchronization History feature that allows you to view the details of completed sync workflow runs, password sync rule runs, and map and unmap operations.
The synchronization history also helps you troubleshoot synchronization issues by providing information on the errors that were encountered during sync workflow runs, password sync rule runs, or map and unmap operations.
You can also selectively clean up entries from the synchronization history.
To access the synchronization history, use the Sync History tab in the Synchronization Service Administration Console.
In this chapter: