AD azul Set password to never expire. Check & set a password to never expire on single or multiple Directorio activo de Azure users’ accounts.
NOTA: This applies only to cloud-based accounts, if you are synching accounts from the local Directorio activo a AD azul, you need to set passwords to never expire on the local Directorio activo account.
Check
Single User
Check expiration policies for a single user’s password:
Get-AzureADUser -ObjectId UPN | Select-Object UserPrincipalName, @{N="PasswordNeverExpires";E={$_.PasswordPolicies -contains "DisablePasswordExpiration"}
}
PowerShellExample:
Get-AzureADUser -ObjectId user@enterinit.com | Select-Object UserPrincipalName, @{N="PasswordNeverExpires";E={$_.PasswordPolicies -contains "DisablePasswordExpiration"}
}
PowerShellMultiple Users
Check expiration policies for multiple user’s passwords using a CSV input file:
Import-CSV azureadusers.csv | ForEach {
Get-AzureADUser -ObjectId $_.AzureADUPN | Select-Object UserPrincipalName,@{N="PasswordNeverExpires";E={$_.PasswordPolicies -contains "DisablePasswordExpiration"}
}
}
PowerShellNOTA: The CSV file must contain the User Principal Name (UPN) of the AD azul users:
AzureAD
user1@enterinit.com
user2@enterinit.com
user3@enterinit.com
PowerShellSet
Single User
Set a password to never expire for a single user’s password:
Set-AzureADUser -ObjectId UPN -PasswordPolicies DisablePasswordExpiration
PowerShellExample:
Set-AzureADUser -ObjectId user@enterinit.com -PasswordPolicies DisablePasswordExpiration
PowerShellMultiple Users
Set a password to never expire for multiple user’s passwords using a CSV input file:
Import-CSV azureadusers.csv | ForEach {
Set-AzureADUser -ObjectId $_.AzureADUPN -PasswordPolicies DisablePasswordExpiration
}
PowerShellNOTA: Check the expiry has been set correctly by running Get-AzureADUser:
Import-CSV azureadusers.csv | ForEach { Get-AzureADUser -ObjectId $_.AzureADUPN | Select-Object UserPrincipalName, ` @{N="PasswordNeverExpires";E={$_.PasswordPolicies -contains "DisablePasswordExpiration"}
}
}
PowerShell
very helpful . thank you.