PS: Get last logon time on exchange

To get the last logon time for a user in exchange use the following powershell script:

Get-MailboxStatistics -identity "Joe smith" | select-object displayname, lastlogontime

If you want to see the lastlogontime for all users in a Distribution group, use the following powershell script:

 

$usergroup = Get-DistributionGroupMember -identity "DL name" -domaincontroller dcname

foreach ($user in $usergroup) { Get-MailboxStatistics -identity $user.samaccountname | select-object displayname, lastlogontime}

 

Leave a Reply

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