Exchange 2010 Powershell commands that include active directory information

I can run a powershell command to get mailbox statistics such as displayname,totalitemsize,itemcount.  How do you include the database location of each user and their title and department?
DonnaWestAsked:
Who is Participating?
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.

A KarelinCommented:
You can use Get-ADUser for Department and Title. You need to link the output of these two commands. :)

Get-MailboxStatistics -Identity $user | select displayname, databasename, totalitemsize, itemcount
Get-ADUser $user -Properties Department, title | select Department, title

Open in new window

0
DonnaWestAuthor Commented:
Thank you for your response.  I tried the commands you listed, but it did not work.  The message I received was: "The term 'get-ADuser' is not receognized as the name of a cmdlet, function, script file, or operable program."

Is there another term I should be using?
0
A KarelinCommented:
Import-Module ActiveDirectory

If that returns an error, chances are that you do not have the module on your computer.  You can verify that by running

Get-Module -ListAvailable
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

DonnaWestAuthor Commented:
I did run the get-module command.  Active Directory is listed.
0
A KarelinCommented:
Ok.
make "Import-Module ActiveDirectory". Afte that you can use ad commandlets.
0
DonnaWestAuthor Commented:
Ok.  That worked.  We're no longer getting the error.  However, I think the wording in my initial question may have misled you.  I'm sorry about that.  What I actually need is the mailbox statistics for all databases including all users along with their titles and departments.
0
A KarelinCommented:
Get-ADUser  -Filter {enabled -eq $true -and mail -ne $true} -Properties Department, Title, mail 
Get-Mailbox | Get-MailboxStatistics | select displayname, databasename, totalitemsize, itemcount

Open in new window

Ok. These commands show all enabled users this email address and statistics. But their output are separated cause its just two command :)
I dont have the powerhell right now and here and cant write good script.
0

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
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.