Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# 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