o365 mail id individual we need set password never expire

Suraj N R 0 Reputation points
2026-11-11T11:16:23.7066667+00:00

o365 mail id individual we need set password never expire

Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments

1 answer

Sort by: Most helpful
  1. AI answer

    2026-11-11T11:17:20.4933333+00:00

    Set the individual Microsoft 365 user’s PasswordPolicies value to DisablePasswordExpiration with Microsoft Graph PowerShell.

    Set one user’s password to never expire

    You need at least the User Administrator role and a Microsoft Graph connection with user write permission.^1^

    Install-Module Microsoft.Graph.Users -Scope CurrentUser
    
    Connect-MgGraph -Scopes "User.ReadWrite.All"
    
    Update-MgUser `
      -UserId "[Email]" `
      -PasswordPolicies "DisablePasswordExpiration"
    

    Replace [Email] with the user’s Microsoft 365 sign-in address. Administrator consent might be required for the requested Graph permission.

    This changes only the account’s password-expiration policy; it does not change its current password.

    Verify the setting

    Get-MgUser `
      -UserId "[Email]" `
      -Property UserPrincipalName,PasswordPolicies |
    Select-Object UserPrincipalName,
      @{Name="PasswordNeverExpires"; Expression={
          $_.PasswordPolicies -contains "DisablePasswordExpiration"
      }}
    

    PasswordNeverExpires should return True.^1^

    Important exceptions

    • Synced from on-premises Active Directory: The on-premises password policy and Entra Connect configuration can affect expiration behavior. Non-expiration must be explicitly assigned to synchronized accounts that require it. A full password-hash synchronization can clear this property in certain configurations, requiring it to be applied again.^2^
    • Guest account: Password expiration is controlled by the guest user’s home tenant, not by the tenant that invited the guest.^3^

    Security and reversal

    Use non-expiring passwords only where justified because a compromised password can remain usable longer. Protect the account with MFA and appropriate Conditional Access and sign-in monitoring controls.^4^ Change the password immediately if compromise is suspected.

    To restore normal expiration for that user:

    Update-MgUser `
      -UserId "[Email]" `
      -PasswordPolicies "None"
    

    Be aware that restoring expiration can require an immediate password change if the existing password is already older than the applicable maximum age.^1^


    References

    1. Password policies and account restrictions in Microsoft Entra ID
    2. Implement password hash synchronization with Microsoft Entra Connect Sync
    3. Password policy overview and frequently asked questions
    4. The benefits in setting 'Password expiration policy' to 'Set passwords to never expire (recommended)'? - Microsoft Q&A
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.