[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2134
  • Last Modified:

Get-Mailbox with users database and jobtitle

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
damejen
Asked:
damejen
  • 3
  • 3
1 Solution
 
SubsunCommented:
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
 
damejenAuthor Commented:
Brilliant!!! Thanks for the help Subsun, this hit the nail on the head.
0
 
damejenAuthor Commented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
SubsunCommented:
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
 
damejenAuthor Commented:
Thanks a million Subsun. Works like a charm.
0
 
SubsunCommented:
You are welcome!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now