Skip to content

Instantly share code, notes, and snippets.

@morgansimonsen
Created December 19, 2013 19:35
Show Gist options
  • Save morgansimonsen/8044861 to your computer and use it in GitHub Desktop.
Save morgansimonsen/8044861 to your computer and use it in GitHub Desktop.
Set non-expiring password for Office 365 users
Import-Module MSOnline
$MSOLCred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $MSOLCred -Authentication Basic –AllowRedirection
Import-PSSession $Session
Connect-MsolService -Credential $MSOLCred
Get-MsolUser | Set-MsolUser -PasswordNeverExpires $true
Remove-PSSession $session
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment