Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marckean/7d276bf585d5bea2dbdf0f6d31d8aeef to your computer and use it in GitHub Desktop.
Save marckean/7d276bf585d5bea2dbdf0f6d31d8aeef to your computer and use it in GitHub Desktop.
# Install the new Azure AD module - as administrator
Install-Module AzureAD
$user = "powershell"
# Connect to the AzureAD
Connect-AzureAD -TenantId 'h8c94336-3a68-12d7-h456-736458936j21'
# Get & see the Password Policy - it might exist already
(Get-AzureADUser -SearchString $user).PasswordPolicies
# Add the password policy to Disable Password Expiration
Get-AzureADUser -SearchString $user | Set-AzureADUser -PasswordPolicies DisablePasswordExpiration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment