Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
IBM Lotus Domino Notes FIM MIM PowerShell Management Agent Password Script. Supporting blog post is located here
[switch] $UnlockAccount,
[switch] $ForceChangeAtLogOn,
[switch] $ValidatePassword
$log = "C:\PROGRA~1\MICROS~4\2010\SYNCHR~1\EXTENS~2\NotesPWD\Debug\PWDSync.txt"
"=============================================================" | out-file $log -Append
$DisplayName = $_["displayName"].Value
"Display Name: $DisplayName" | Out-File $log -Append
"Action: $Action" | Out-File $log -Append
"Old pwd: $OldPassword" | Out-File $log -Append
"New pwd: $NewPassword" | Out-File $log -Append
"Unlock: $UnlockAccount" | Out-File $log -Append
"Force change: $ForceChangeAtLogOn" | Out-File $log -Append
"Validate: $ValidatePassword" | Out-File $log -Append
# Create a Lotus Domino Session using the Com Class
# from the local machine created by the Lotus Domino Client install
$Session = New-Object -comobject Lotus.NotesSession
#Specifying the Password (the password matching your file) provided from the MA Config
$NotesPassword = $Password
# The Domino Server that has our PWDChange DB
$NotesHost = "XXXNotes1/XXXXX-Aus"
# The DB Name that contains our Notes Agents that will perform the Password Chage
$Database = "IDVaultP.nsf"
# Initialize the Notes Session. Uses the Default ID from the local Notes Client
# and the associated settings in the notes.ini config file
# Get the DB
$db = $Session.GetDatabase($NotesHost, $Database)
"Database: $db.Filename" | Out-File $log -Append
# Create a new Document with the details of the user to change the password for
$newdoc = $db.CreateDocument()
# serer to run the Agent on
# users Notes name in the format of "Joe Blogs/OrgUnit/Organization
# new password
# save the document
$view = $db.GetView('PWDChange')
$writtendoc = $view.GetLastDocument()
"Last Document $writtendoc" | Out-File $log -Append
# Run our Agent to process the change.
$triggerAgent = $db.GetAgent("MIMPwdTrigger")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment