Guest User

Untitled

a guest
Jan 15th, 2018
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Write-Host 'BPOS Admin Username: '
  2. $bposlogin = Read-Host
  3.  
  4. Write-Host 'BPOS Admin Password:'
  5. $bpospwd = read-host -assecurestring
  6.  
  7. $bposcred = new-object -typename System.Management.Automation.PSCredential -argumentlist $bposlogin, $bpospwd
  8.  
  9. import-csv .\Passwords.csv | foreach {
  10.     Set-MSOnlineUserPassword -Identity $_.user -Password $_.pass -ChangePasswordOnNextLogon:$false -Credential $bposcred | fl Identity
  11.     Get-MSOnlineUser $_.user -Credential $bposcred  | fl Identity, PasswordExpirationDate
  12. }
Add Comment
Please, Sign In to add comment