Powershell to check last window login time on all user accounts who has mailbox

Powershell to check last window login time on all user accounts who has mailbox in Exchange Server. Below commands need to be executed on the Activel Roles cmd Shell. Its using Get-QADUser to find all the required details

Get-QADUser -IncludeAllProperties |?{($_.msexchhomeservername -ne $null) -and $_.LastLogonTimestamp -lt (get-date).AddDays(-30)} | select name,LastLogonTimestamp

Leave a comment