Saturday, June 6, 2009

Get-ExchangeServer Mailbox Count

If you want to get quickly the mailbox count on each storage group on specific mail server or all mail servers here is the PS script and PowerGUI usage, remember to include this one to your existing PowerGUI toolbox for daily usage. Exporting these outputs to CSV file is incredibly easy with powerGUI.

PS


Get-ExchangeServer | Get-MailboxDatabase | select Identity,@{n='MailboxCount';e={@(Get-Mailbox -database $_.identity).count}}

Click below to download it

image

One thing I found very convenient to do and more useful for learning PS is to use PowerGUI script editor first to test the PS script to make sure it is producing expected results and when all good open PowerGUI.

  • Open PowerGUI Script Editor
image

  • To run the script press green run arrow on top or simply use
  • CTRL + F5

image

  • Open PowerGUI now go to your PS Scripts folders
  • right click
  • Script node simply copy and paste the same PS code

image

here is the output

image

And your script library is getting more powerful each time you add another one

 

 

image

those of you who have been fallowing these simple way of building powerful scripting library will already see the power of PS and powerGUI, when you have right tools and right mind set you don't have to be so smart to get the work done (-:

and finally get your free kung-FU Panda Power GUI exchange BG and hope you like it , click on the picture to go to my SkyDrive to download the free Backgrounds

image

Cheers,

oz

Oz Casey Dedeal

MVP (Exchange)
MCITP (EMA), MCITP (SA)
MCSE 2003, M+, S+, MCDST
Security+, Project +, Server +

Http://smtp25.blogspot.com (Blog)

Https://telnet25.spaces.live.com (Blog)

Https://telnet25.worldpress.com (Blog)

1 comment:

Anonymous said...

Thanks - it worked like a charm, and we even discovered a corrupt mailbox in the process! Brook