Azure AD Ustaw hasło tak, aby nigdy nie wygasało. Sprawdzać & set a password to never expire on single or multiple Azure Active Directory użytkownicy’ accounts.
NOTATKA: This applies only to cloud-based accounts, if you are synching accounts from the local Active Directory to Azure AD, you need to set passwords to never expire on the local Active Directory account.
Sprawdzać
Single User
Check expiration policies for a single user’s password:
Get-AzureADUser -ObjectId UPN | Select-Object UserPrincipalName, @{N="PasswordNeverExpires";E={$_.PasswordPolicies -contains "DisablePasswordExpiration"}
}
Przykład:
Get-AzureADUser -ObjectId user@enterinit.com | Select-Object UserPrincipalName, @{N="PasswordNeverExpires";E={$_.PasswordPolicies -contains "DisablePasswordExpiration"}
}
Multiple 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"}
}
}
NOTATKA: The CSV file must contain the User Principal Name (UPN) of the Azure AD users:
AzureAD
user1@enterinit.com
user2@enterinit.com
user3@enterinit.com
Ustawić
Single User
Set a password to never expire for a single user’s password:
Set-AzureADUser -ObjectId UPN -PasswordPolicies DisablePasswordExpiration
Przykład:
Set-AzureADUser -ObjectId user@enterinit.com -PasswordPolicies DisablePasswordExpiration
Multiple 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
}
NOTATKA: 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"}
}
}
very helpful . Dziękuję.