Bize Ulaşın / Contact Us

Set a user’s password to never expire on Office365

22 / 08 / 2017 by AD, Office365 Yorum yok / No Comments

If you need to set a user’s password to never expire on your Office 365, you need to do that with PowerShell. And it is really easy.

  1. We save our credentials to a variable called $creds, running this command will open a Sign in to your account windows, so sign in with your Office 365 admin account.

    PS C:\> $creds = Get-Credential
    cmdlet Get-Credential at command pipeline position 1
    Supply values for the following parameters: Credential

  2. Run the Connect-MsolService command to connect to the service:

    PS C:\> Connect-MsolService -Credential $creds

  3. Run the following command to see the current status:

    PS C:\> Get-MsolUser -UserPrincipalName [email protected] | Select Passw*
    PasswordNeverExpires PasswordResetNotRequiredDuringActivate
    ——————– ————————————–
    False

  4. Now run the following command to set the password to never expire:

    PS C:\> Set-MsolUser -UserPrincipalName [email protected] -PasswordNeverExpires $true

  5. And run the following command again to verify the password is now set to expire:

    PS C:\> Get-MsolUser -UserPrincipalName [email protected] | Select Passw*
    PasswordNeverExpires PasswordResetNotRequiredDuringActivate
    ——————– ————————————–
    True

 

Hope it helps.

Osman

 

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

*

Kontrol / Control * Time limit is exhausted. Please reload CAPTCHA.