Go Premium for a chance to win a PS4. Enter to Win

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

Exchange 2007 - Script to count contacts?

Does anyone have a script that I can run that will tell me how many contacts each user has?  We are going to implement a CRM and marketing is asking me how many contacts that each user has.  Thank you for your help.
0
mattpayne59
Asked:
mattpayne59
1 Solution
 
Glen KnightCommented:
This should work, I've just tested it on Exchange 2007 and Exchange 2010.

Get-Mailbox -ResultSize Unlimited | Sort-Object -Property DisplayName | get-MailboxFolderStatistics -FolderScope Contacts | Format-Table Identity, ItemsInFolder

This will give you the mailbox and the number of items.
1
 
mattpayne59Author Commented:
Got me close enough.  The Identity column was cutting off and not really showing me the name.  Here was my final script:

Get-Mailbox | foreach {
   $mbx = $_.DisplayName;
   Get-MailboxFolderStatistics $_.identity -FolderScope 'Contacts' | select @{n="DisplayName";e={$mbx}},FolderPath,ItemsInFolder} | export-csv c:\TEST.csv

0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

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