Jump to content
  • entries
    142
  • comments
    0
  • views
    87563

Manage Office 365 password expiration


proximagr

1250 views

 Share

1. Check if the password is set to never expire for one user:

 

Get-MSOLUser -UserPrincipalName username | Select PasswordNeverExpires

 

2. Check if the password is set to never expire for all users:

 

Get-MSOLUser | Select UserPrincipalName, PasswordNeverExpires

 

3. Check if the password is set to never expire for a list of users:

 

create a txt file listing the required users, line by line with title “username”, and save it as c:\pwdexpire.txt, like this:

 

username
testuser1
testuser2
testuser3

 

then run:

 

Import-csv c:\pwdexpire.txt | for each { Get-MSOLUser -UserPrincipalName $_.username | Select PasswordNeverExpires }

 

4. Set password to never expire for one user:

 

Set-MsolUser -UserPrincipalName username -PasswordNeverExpires $true

 

5. Set password to never expire for all users:

 

Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $true

 

6. Set password to never expire for a list of users:

 

like before create a txt list and run:

 

Import-csv c:\pwdexpire.txt | for each { Set-MsolUser -UserPrincipalName $_.username -PasswordNeverExpires $true }

 

7. to re-set the password to expire just replace the $true with $false (please note that is the organization’s password expiration period has passed then the user/users will be locked and you will need to reset their passwords)

 

source: http://www.e-apostolidis.gr/microsoft/manage-office-365-password-expiration/

 Share

0 Comments


Recommended Comments

There are no comments to display.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...