How can I see users' Office 365 Password date (date last changed, date it will expire, etc.)?

1

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

Jono

Posted 2016-04-21T19:18:59.503

Reputation: 45

Answers

1

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.

Jono

Posted 2016-04-21T19:18:59.503

Reputation: 45

0

To properly calculate the Age against UTC time, you can use the ToUniversalTime() method.

Get-MsolUser -All | select DisplayName, LastPasswordChangeTimeStamp,@{Name=”PasswordAge”;Expression={((Get-Date).ToUniversalTime())-$_.LastPasswordChangeTimeStamp}} | sort-object PasswordAge -desc

Toby

Posted 2016-04-21T19:18:59.503

Reputation: 1

What's so different about this answer that's not already mentioned in the other answer again? Also, if you determine this is indeed not a duplicated answer then consider clarifying and add a little more context to this answer to convey what you are suggesting exactly and why it works, etc. You know, consider adding some reference to this answer supporting what you state and why it is. – Pimp Juice IT – 2017-08-16T23:53:49.283

I see the difference. A more accurate list will result by doing the calculation against UTC since that's the dates and times that PS uses. Without the added expression, there would be a few hours difference as it calculated against the computer time instead of UTC. Is that correct @Toby? – Jono – 2017-08-18T11:03:01.510

0

Thought of sharing this here.

This script generates 7 different Office 365 password reports.

https://o365reports.com/2020/02/17/export-office-365-users-last-password-change-date-to-csv/

Using this script, you can generate following password reports.

  • Pwd Expiry Date Report
    • Pwd Last Change Date Report
    • Pwd Expired Users Report
    • Pwd Never Expires Users Report
    • Soon-to-Expire Pwd Users Report
    • Recently Pwd Changed Users Report
    • Password Report for Licensed Users

enter image description here

Kathy Cooper

Posted 2016-04-21T19:18:59.503

Reputation: 53