Q: How can I set an Azure Active Directory password to not expire?
A: To set an Azure Active Directory account to have a non-expiring password, perform the following steps:
- Ensure the Microsoft Online Services Sign-In Assistant for IT Professionals is installed.
- Install the Azure AD module.
- Launch the Azure Active Directory Module for Windows PowerShell shortcut.
Connect to an Azure Active Directory instance; for example:
$msolcred = get-credential connect-msolservice -credential $msolcred
- You can use get-msoluser to view all users.
To set an account so its password doesn't expire, use:
set-msoluser -userprincipalname <user, e.g. [email protected]> -passwordneverexpires $true get-msoluser | select UserPrincipalName, PasswordNeverExpires