Clicky

I wanted to know if there was a PS cmd that I can run against each domain that will pull all users will mailboxes and show the date when the mailbox was last accessed and perhaps what account did access it?

asked 11/21/2011 03:07

Admin_Stooge's gravatar image

Admin_Stooge ♦♦


10 Answers:
The only way I know of is with the Get-MailboxStatistics cmdlet. There are however some issues with these results, as discussed in detail at the following links:

http://exchangeserverpro.com/last-logon-time-exchange-2010-mailbox-users
http://www.techrepublic.com/blog/datacenter/gather-exchange-2010-mailbox-information-with-a-powershell-command/2844

-Ninjatek
link

answered

ninjatek's gravatar image

ninjatek

Thanks.
What would the cmd actually be to export all individuals with a mailbox or on a particular domain to a cvs file?

I would like to to see the following results:
LastLoggedOnUserAccount
LastLogoffTime
LastLogonTime

Thanks
link

answered 2011-11-21 at 11:12:32

Admin_Stooge's gravatar image

Admin_Stooge

So how can I someone like this "Get-MailboxStatistics | format-table DisplayName,LastLogoffTime,LastLogonTime,LastLoggedonUserAccount"  against all users?
link

answered 2011-11-21 at 11:20:34

Admin_Stooge's gravatar image

Admin_Stooge

By default it shall return it for all users, if you want specific items use the following parameter

Get-MailboxStatistics -Identity <mailbox>
link

answered 2011-11-21 at 11:33:58

jamie_gillespie's gravatar image

jamie_gillespie

Get-MailboxStatistics | Select DisplayName, LastLoggedOnUserAccount, ItemCount, TotalItemSize, LastLogonTime, LastLogoffTime | Export-CSV D:\test.csv

This cmd will only pull the local 2007 mbx server you run the cmd from.

link

answered 2011-11-21 at 12:01:40

Admin_Stooge's gravatar image

Admin_Stooge

Use the -server parameter to get information on another server e.g.

Get-MailboxStatistics -server "exchangeserver 2" | Select DisplayName, LastLoggedOnUserAccount, ItemCount, TotalItemSize, LastLogonTime, LastLogoffTime | Export-CSV D:\test.csv
link

answered 2011-11-21 at 12:17:55

jamie_gillespie's gravatar image

jamie_gillespie

ok...find it rather silly that I have to run this script several times for each 2007 mailbox server but if that is what it takes to do this then ok
link

answered 2011-11-21 at 12:20:25

Admin_Stooge's gravatar image

Admin_Stooge

I was able to use these cmds to pull the required information against all exchange clusters

Get-ExchangeServer | Where-Object {$_.Name -match "uspho-mxvs" } |Get-MailboxStatistics | Select DisplayName, LastLoggedOnUserAccount, LastLogonTime, LastLogoffTime | Export-CSV D:\mbxaccess.csv


Get-ExchangeServer | Where-Object {$_.Name -match "ukhig-mxvs" } |Get-MailboxStatistics | Select DisplayName, LastLoggedOnUserAccount, LastLogonTime, LastLogoffTime | Export-CSV D:\mbxaccess.csv
link

answered 2011-11-21 at 12:24:31

Admin_Stooge's gravatar image

Admin_Stooge

That is awesome! Thanks for posting.
link

answered 2011-11-21 at 13:49:36

jamie_gillespie's gravatar image

jamie_gillespie

My cmd actually provided the information I needed

link

answered 2011-11-21 at 13:50:57

Admin_Stooge's gravatar image

Admin_Stooge

Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×3
×1
×25
×23

Asked: 11/21/2011 03:07

Seen: 296 times

Last updated: 12/12/2011 05:19