Mass password resets in BPOS

Following on from mass BPOS account activations you can now perform mass password resets with the latest Microsoft Online Services Migration Tools. The PowerShell script below will read in a list of BPOS accounts and reset the password. The two fields you need in the CSV file are the email address and desired password. See the BPOS password requirements before establishing a new password. In the script below you can choose not to force the user to change the password you assign to them by changing the value of “-ChangePasswordOnNextLogon:$true” to “-ChangePasswordOnNextLogon:$false”.
To run this you must have admin privileges in BPOS and you must have the MSOL Migration Tools installed locally. Save this text with a PowerShell extension (i.e. massPwdChg.ps1) and open a Migration Command Shell and run the command by typing “.massPwdChg.ps1”. Make sure the paths in the script exist or change them to suit your needs (i.e. “C:Migration” and “C:MigrationScriptLogs”). The input file is assumed to be massPwdChg.csv.
Here’s a sample CSV file format:
”Test Account”,,P@ssw0rd

# Microsoft PowerShell Source File -- Created with SAPIEN Technologies PrimalScript 2009
# NAME: massPwdChg.ps1
# AUTHOR: Erik Enger , PointBridge
# DATE : 11/03/2009
# COMMENT: Use this script to perform a mass password change of BPOS accounts
# Note: This script requires the Microsoft Exchange Transporter snapin
# Modify the default PowerShell profile to add the Quest Snap-In
# c:windowssystem32windowspowershellv1.0profile.ps1
# add-pssnapin Microsoft.Exchange.Transporter
# ==============================================================================================
# Get the login ID for the BPOS admin account
write-host 'Enter the username for the MS Exchange Online admin (i.e. '
$bposlogin = Read-Host
# Get the password for the BPOS admin account in a secure fashion (display * for password)
write-host 'Enter the password for the MS Exchange Online admin (i.e. ' -foregroundcolor yellow -BackgroundColor darkmagenta
$bpospwd = read-host -assecurestring
# Form the BPOS encrypted credential information and store it in a variable to be passed to upcoming commands
$bposcred = new-object -typename System.Management.Automation.PSCredential -argumentlist $bposlogin, $bpospwd
write-host "`n`n`n"
import-csv c:migrationmassPwdChg.csv | foreach {
## Start a Transcript
$file+= $ +"-massPwdChg.log"
Start-Transcript -Path $file -NoClobber:$false
Write-Host "Resetting BPOS password for:" $
# Set the password and prompt for change on next logon
Set-MSOnlineUserPassword -Identity $_.mail -Password $_.passwd -ChangePasswordOnNextLogon:$true -Credential $bposcred -Verbose
## Stop the log
Write-Host `n`n`n
About the Author

More from this Author

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Subscribe to the Weekly Blog Digest:

Sign Up