Get-mailboxStatistics Returns Contact Information??

Hi all -  I have a feeling this will be fairly quick.  We are running the attached scripts to identify mailboxes that have not been logged into for he past 6 months in order to facilitate the decommissioning of a legacy environment.  However, when we run it it appears to also return contacts from the targeted server.  We just want a list of actual mailboxes.  Is there a way to filter out contacts from actual mailboxes?


Or perhaps I should be running a different command? command
LVL 1
wrenmottAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

prashanthdCommented:
I am not sure why it is returning contacts, but you can try the following
get-mailboxstatistics -server am-lon-ex02 | where {($_.LastLogonTime -lt (get-date).adddays(-180)) -and ($_.ObjectClass -eq "Mailbox")} | out-file mailboxes.txt

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Madan SharmaConsultantCommented:
Try this one.
[PS] C:\>Get-Mailbox -Server am-lon-ex02 | Get-MailboxStatistics | Format-Table DisplayName, ItemCount, StorageLimitStatus, LastlogonTime | Out-File C:\Login.txt

Open in new window

endital1097Commented:
It is not possible for this cmdlet to return contacts as there is no mailbox to pull statistics from
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.