Word – How to see users’ Office 365 Password date (date last changed, date it will expire, etc.)

office365password-managementpowershell

I know I can see the password dates (date last changed, date it will expire, etc.) for our in-house Active Directory. How do I see this information for Office 365 accounts, either with PowerShell or in any other way? This information is very handy to have at times. I especially need to see when people's passwords were changed.

Thanks,
Jono

Best Answer

I think I have it, or at least I have enough to figure out what I need.

Get-MsolUser -userprincipalname user@domain.org | select DisplayName, LastPasswordChangeTimeStamp,@{Name=”PasswordAge”;Expression={(Get-Date)-$_.LastPasswordChangeTimeStamp}}

The result looks like this (date and time format will match your computer's):

DisplayName    LastPasswordChangeTimestamp PasswordAge
-----------    --------------------------- ----------- 
User, Name     09-Mar-16 5:48p             42.22:34:10.6964630

.

In order to see all users whose passwords are older than 30 days, use this.

Get-MsolUser -All | select DisplayName, LastPasswordChangeTimeStamp,@{Name=”PasswordAge”;Expression={(Get-Date)-$_.LastPasswordChangeTimeStamp}} | where {$_.PasswordAge -gt “30”} | sort-object PasswordAge -descending

It will list all of the users with passwords older than 30 days and sort the list by the password age.

I hope this helps others as well.

Related Question