Powershell - Mailbox LastLogonTime - Query...!
HI
I've been getting to grips with Power shell on EX 2007 SP1.
We just moved 5000 users onto the new environment, but have come up against a bit of an issue that I cannot work around. I want to check anyone who hasn't logged into their mailbox for over 90 days. I run something like:
Get-MailboxStatistics | Where {$_.LastLogonTime -lt $d}
which is fine, except that we have Archive mail management software which logs into the mailboxes during the night, screwing up that information (i.e. everyone was logged into by that service account at the same time and showing that as the last logon).
Anyway I can alter the script in such a way that I can find out when the mailbox was actually logged into by the user and not the service account?
I hope that was clear
Thanks in advance.
September 25th, 2008 4:40pm
Hello,
You can alter the service account logon by this way...
Get-MailboxStatistics -server"YourServerName" | Where {($_.LastLogonTime -gt (get-date).adddays(-90)) -and -not ($_.LastLoggedOnUserAccount -like "*ServiceAccount*")}
Free Windows Admin Tool Kit Click here and download it now
September 25th, 2008 6:44pm
Hi Amit
Will try this with the change and post back.
September 25th, 2008 7:02pm
Hi, Stuscotland, I suppose your question has been answered, and I'd like to change the status to "Marked as answer", please feel free to post here if you have any update
An alternative option: EMC->"View" menu->"Add/Remove Columns"->Add "Last Modified Time" to right column, and then you can see the time over 90 in the "EMC->Recipient Configuration->Mailbox"
Free Windows Admin Tool Kit Click here and download it now
September 29th, 2008 5:26am