Solved

Get-Mailbox with users database and jobtitle

Posted on 2013-12-10
6
1,509 Views
Last Modified: 2013-12-10
Wondering if anyone can help out with this, I'm looking to find all the mailboxes with users database and what their job title is.

I have run this EMC cmdlet though not quite getting what im looking for.

Get-Mailbox -ResultSize Unlimited | select firstname, lastname, primarysmtpaddress, jobtitle, database | Export-Csv c:\SMTPList.csv

it gives me a list of all the mailboxes and what the Primary SMTP Address is and what database but not the jobtitle.

Exhchange 2007.

Thanks.
0
Comment
Question by:damejen
  • 3
  • 3
6 Comments
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 39708294
Get-Mailbox output does not have properties called jobtitle, firstname & lastname. You need to create custom properties to get these details in your report..
Try..
Get-Mailbox -ResultSize Unlimited | % {
$Obj = $_ | Get-Recipient
$_ | Select @{N="firstname";E={$Obj.firstname}}, @{N="lastname";E={$Obj.lastname}}, primarysmtpaddress,@{N="JobTitle";E={$Obj.Title}}, database
}| Export-Csv c:\SMTPList.csv

Open in new window

0
 

Author Closing Comment

by:damejen
ID: 39708310
Brilliant!!! Thanks for the help Subsun, this hit the nail on the head.
0
 

Author Comment

by:damejen
ID: 39708539
Hi Subsun, hope you could help with adding something else to this, getting the mailbox sizes as well? Not sure if you would pipe Get-MailboxStatistics in there somehere?

thanks.
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 40

Expert Comment

by:Subsun
ID: 39708663
Try this..
Get-Mailbox -ResultSize Unlimited | % {
$Obj = $_ | Get-Recipient
$_ | Select @{N="firstname";E={$Obj.firstname}}, @{N="lastname";E={$Obj.lastname}}, primarysmtpaddress,@{N="JobTitle";E={$Obj.Title}},database,@{N="TotalItemSize";E={($_ | Get-MailboxStatistics).TotalItemSize}}
}| Export-Csv c:\SMTPList.csv

Open in new window

In future please open a new question for additional requests.. :-)
0
 

Author Comment

by:damejen
ID: 39708720
Thanks a million Subsun. Works like a charm.
0
 
LVL 40

Expert Comment

by:Subsun
ID: 39708728
You are welcome!
0

Featured Post

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!

Join & Write a Comment

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
Ever notice how you can't use a new drive in Windows without having Windows assigning a Disk Signature?  Ever have a signature collision problem (especially with Virtual Machines?)  This article is intended to help you understand what's going on and…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…

760 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

20 Experts available now in Live!

Get 1:1 Help Now