Solved

Exchange 2010 Powershell commands that include active directory information

Posted on 2014-12-02
8
6 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

Integrate social media with email signatures

Is your company active on social media? Do you also use email signatures? Including social media icons in your email signature is a great way to get fans for free. Let all your email users know you’re on social media quickly and easily, in a single click.

Join & Write a Comment

Easy CSR creation in Exchange 2007,2010 and 2013
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.
In this video we show how to create a mailbox database 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 Servers >> Data…
This video discusses moving either the default database or any database to a new volume.

758 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now