Solved

Exchange 2010 Powershell commands that include active directory information

Posted on 2014-12-02
8
16 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 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
Office 365 Training for IT Pros

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

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

In-place Upgrading Dirsync to Azure AD Connect
This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

691 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