PowerShell Script to set all passwords to be the same in Office365

Create a CSV file with the following format:
UPN,Password
mary@mycompany.ie,Ireland1002*
save it as resetuserpassword.csv

$LiveCred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
Import-PSSession $Session
Connect-Msolservice
Import-CSV “c:\users\pgilbride\desktop\resetuserpassword.csv” | foreach {Set-MsolUserPassword -userPrincipalName $_.UPN -NewPassword $_.Password -ForceChangePassword $false1}

Obviously change the location above (in bold) to be that of your CSV file location.

This saved me a lot of time, but you still need to change the password to something else. At least you don’t need to remember what each temp one is. Once i find the script to do that i will post here.

Advertisements

One Comment Add yours

  1. Keith says:

    Awesome thx! 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s