Exchange 2007 finding the Active mailboxes?
How can I find the active mailboxes and export the results in csv file?
February 10th, 2011 3:09am
Please elaborate what you meant by active mailboxes. If you are looking for list of all the mailboxes in your organization you can simply use the below cmdlet.
Get-Mailbox -Resultsize unlimited | Export-Csv "filename"
Free Windows Admin Tool Kit Click here and download it now
February 10th, 2011 6:11am
I want to know the list of users who have not logged in to system since last 2 months. I remember seeing something like this once on net but forget the location now.
February 10th, 2011 6:13am
You can try this.
$Olddate = (Get-Date).Adddays(-60)
Get-MailboxServer | Get-Mailboxstatistics -resultsize unlimited | where {$_.LastLogondate -lt $olddate} | select DisplayName | export-csv "filename.csv"
Free Windows Admin Tool Kit Click here and download it now
February 10th, 2011 6:38am
I am getting following error:
Get-MailboxStatistics : A parameter cannot be found that matches parameter name
'resultsize'.
At line:1 char:54
+ Get-MailboxServer | Get-Mailboxstatistics -resultsize <<<< unlimited | where
{$_.LastLogondate -lt $olddate} | select DisplayName | export-csv "c:\filename
.csv"
+ CategoryInfo : InvalidArgument: (:) [Get-MailboxStatistics], Pa
rameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.Exchange.Manage
ment.MapiTasks.GetMailboxStatistics
February 10th, 2011 7:02am
Oops...remove that clause "Resultsize unlimited" and try.
Free Windows Admin Tool Kit Click here and download it now
February 10th, 2011 7:03am
I would also get the lastloggedonuseraccount since service accounts can log onto those mailboxes basically making lastlogontime useless. Typically run several samples over couple days if you absolutely want to be positive. Also check permissions on those
mailboxes and follow up with users whose been granted access to those mailboxes.James Chong MCITP | EA | EMA; MCSE | M+, S+ Security+, Project+, ITIL msexchangetips.blogspot.com
February 10th, 2011 1:18pm
Script executed successfully but its not making any difference instead its showing all users who are even logged in now. In other words all the mailbox users in my organization displayed when I run script instead it should display those who are not logged
in since 2 months. Can you please let me know what am I missing?
Free Windows Admin Tool Kit Click here and download it now
February 13th, 2011 3:47am
Are you also piping out the -lastloggedonuseraccount? Service accounts can still continue to log into mailboxes.James Chong MCITP | EA | EMA; MCSE | M+, S+ Security+, Project+, ITIL msexchangetips.blogspot.com
February 13th, 2011 1:03pm
Jamestechman is right. You can add lastloggedonuseraccount to your results so that you can verify if it is the user account or the service account that logged in last time. The alternate option would be to check the last logged on time from the AD object
properties.
Free Windows Admin Tool Kit Click here and download it now
February 14th, 2011 7:25am
Yes I did but all the accounts are normal user account instead service accounts. We have only 10 to 15 service accounts but results shows all 28,000 users.
February 14th, 2011 11:35pm
My bad...Wrong parameter in my last line
Olddate = (Get-Date).Adddays(-60)
Get-MailboxServer | Get-Mailboxstatistics -resultsize unlimited | where {$_.LastLogonTime -lt $olddate} | select DisplayName,lastloggedonuseraccount,lastlogontime | export-csv "filename.csv"
Free Windows Admin Tool Kit Click here and download it now
February 15th, 2011 7:16am