Wednesday, April 4, 2018

Azure: powershell one liner to set one user account password to never expire.

Install-Module -Name MSOnline
Connect-MsolService
$username = "username"
(get-msoluser -UserPrincipalName  $username | select -expand objectID).guid | %{Set-MsolUser -ObjectId $_ -PasswordNeverExpires $true}

No comments:

Post a Comment