This article walks you through the steps to configure an individual user’s password to never expire in Azure Active Directory.
In Azure Active Directory (AAD), user passwords are governed by organizational security policies. While password expiration policies are designed to enhance security, there are cases where you might need to exempt specific users from this policy, such as service accounts, kiosk users, or executives. This article explains how to set an individual user's password to never expire in Azure AD using the Azure portal and PowerShell.
Steps:
Open PowerShell and connect to Azure AD:
Connect-AzureAD
Retrieve the user’s Object ID or UPN (User Principal Name):
Get-AzureADUser -SearchString "username"
Set the user’s password to never expire:
Set-AzureADUser -ObjectId <ObjectId> -PasswordPolicies DisablePasswordExpiration
Install and connect to Microsoft Graph:
Install-Module Microsoft.Graph -Scope CurrentUser
Connect-MgGraph
Retrieve the user details:
Get-MgUser -Filter "userPrincipalName eq '[email protected]'"
Update the user’s password policy:
Update-MgUser -UserId <UserId> -PasswordPolicies "DisablePasswordExpiration"
To confirm that the password expiration setting has been applied:
In the Azure Portal, revisit the user profile and check the Password never expires status.
Using PowerShell:
Get-AzureADUser -ObjectId <ObjectId> | Select-Object PasswordPolicies
Use password exemption sparingly and only for critical accounts:
Service Accounts: Accounts used by applications or automated systems often require uninterrupted access.
Kiosk Accounts: Accounts used on dedicated devices for specific tasks may not require frequent password changes.
Executive Accounts: In some rare cases, executives might require this exemption for exceptional circumstances, but it should be carefully evaluated and justified.
Combine non-expiring passwords with multi-factor authentication (MFA) for enhanced security:
Even if a password never expires, implementing MFA adds a crucial layer of security.
MFA methods like:
Biometrics: Fingerprint, facial recognition
Mobile App Authenticators: Microsoft Authenticator, Google Authenticator
Hardware Tokens: YubiKey, FIDO U2F keys
Regularly audit user accounts with the DisablePasswordExpiration policy:
Conduct periodic reviews to ensure that:
The exemption is still necessary.
The account is actively used and monitored.
There are no signs of compromise.
Implement strong password policies for all other users:
Enforce strong password complexity requirements (length, character types).
Mandate regular password changes for all other users.
Consider using a password manager to help users create and manage strong, unique passwords.
Document the rationale for each password exemption:
Maintain clear records of why specific accounts are exempt from password expiration policies.
This documentation can be helpful for audits, security reviews, and future troubleshooting.
Important Note: Disabling password expiration should be a carefully considered decision. It introduces a security risk by removing a critical security control. Always prioritize security best practices and implement compensating controls to mitigate the risks associated with this exemption.
Yes, use a PowerShell script to loop through user accounts and apply the setting.
No, MFA operates independently of password expiration settings.
Yes, simply reset the PasswordPolicies property to its default state using PowerShell: Set-AzureADUser -ObjectId -PasswordPolicies None