Quantcast
Channel: Technology Ireland » Powershell Commands
Viewing all articles
Browse latest Browse all 5

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

$
0
0
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.



Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images