Created
December 19, 2013 19:35
-
-
Save morgansimonsen/8044861 to your computer and use it in GitHub Desktop.
Set non-expiring password for Office 365 users
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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