?
Solved

Exchange 2010 Powershell commands that include active directory information

Posted on 2014-12-02
8
Medium Priority
?
17 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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
Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
In this video we show how to create an Accepted Domain 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 >> Ac…
In this video we show how to create an email address policy 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…
Suggested Courses

801 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