Solved

Exchange 2010 Powershell commands that include active directory information

Posted on 2014-12-02
8
14 Views
Last Modified: 2016-06-19
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?
0
Comment
Question by:DonnaWest
  • 4
  • 3
8 Comments
 
LVL 5

Expert Comment

by:A Karelin
ID: 40477880
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
 

Author Comment

by:DonnaWest
ID: 40478607
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
 
LVL 5

Assisted Solution

by:A Karelin
A Karelin earned 500 total points
ID: 40478609
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
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 

Author Comment

by:DonnaWest
ID: 40478644
I did run the get-module command.  Active Directory is listed.
0
 
LVL 5

Expert Comment

by:A Karelin
ID: 40478653
Ok.
make "Import-Module ActiveDirectory". Afte that you can use ad commandlets.
0
 

Author Comment

by:DonnaWest
ID: 40478747
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
 
LVL 5

Accepted Solution

by:
A Karelin earned 500 total points
ID: 40480221
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

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
To show how to create a transport rule in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Rules tab.:  To cr…
how to add IIS SMTP to handle application/Scanner relays into office 365.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question