Sie sind auf Seite 1von 2

PowerShell - list Exchange 2003 mailbox information | Black Mountain

http://www.blkmtn.org/powershell-list-exchange2k3-mb-info

PowerShell - list Exchange 2003 mailbox information


Mon, 2007-06-18 12:24 sepeck

We have been exporting some mailbox information manually and I was sort of tired of doing it that way. I thought I'd try to make it work with PowerShell to automate it and add some consistency. It took some experimentation and here it is. It saves to a file, ServerName-Date.csv in the directory it's run from. It has Display Name, Storage Group Name, Store Name, Mailbox size (in kb like ESM) and Date Discovered Absent in DS (which is short for when the Active Directory account the mailbox was associated was deleted).
# Name: list-exchange-mailbox.ps1 # Author: Steven Peck - <a href="http://www.blkmtn.org #" title="www.blkmtn.org #">www.blkmtn.org #</a> Date: 06/15/2007 # Description: Exchange 2003 output to file # Display Name, Store, Storage group, MB Size, and Date Absent in DS # # Get date for file name $day = Get-Date -UFormat "%Y%m%d" # Gets data through WMI from specified Exchange mailbox servers $computers = "server001","server002" foreach ($computer in $computers) { Get-Wmiobject -namespace root\MicrosoftExchangeV2 -class Exchange_Mailbox -computer $computer | sort-object -desc MailboxDisplayName }

I am probably going to make one for just DateDiscoveredAbsentInDS as searching through multiple mail stores to find a mailbox to re-associate it when the account was deleted is a pain. One specific item to add will be an exclusion for "Recovery Storage Groups' as those are all disjointed accounts by their very nature. Using where on a sort should make it easy (I hope). Using just the get-wmiobject portion of the script in a PowerShell console window, you can see a number of other objects your could modify the script to display on.
Get-Wmiobject -namespace root\MicrosoftExchangeV2 -class Exchange_Mailbox -computer MAILBOX_SERVERNAME

For those new to PowerShell as I am, check out the PowerShell Team blog and this new PowerShell podcast series looks promising (I haven't listened to it yet, I noticed it while getting the other link in this post). I am submitting this to the MS Community Script Center as my first ever submission. We'll see if they accept it. Commenting on this Blog entry is closed.

Comments
GREAT SCRIPT
Paul (not verified) - 2008-04-03 10:39

I am trying to find a way to display the Users OU info. I can't find an easy way of doing this. Do you know?

VERY USEFUL... FYI, I FOUND


Eric W (not verified) - 2008-06-12 11:30

Very useful... FYI, I found that you can add a filter to the script to only retrieve mailboxes over 2gb in size. (So you can notify your large mailbox users that their offline folders is likely corrupt and useless.) Here is the changed portion of code with the filter added.
Get-Wmiobject -namespace root\MicrosoftExchangeV2 -class Exchange_Mailbox -computer $computer <strong>-Filter "size>=2097152"

RIGHT ON!!! THIS IS EXACTLY


NukNukGoose (not verified) - 2008-07-29 14:01

Right ON!!! This is exactly what I was looking for. I couldn't navigate the maze of WMI query structures to get something like this out of Hyena, so a big thanks!!!

THANKS FOR THE FEEDBACK. I


sepeck - 2008-07-29 14:12

Thanks for the feedback. I put this stuff up so I can revisit it when I forget and others can benefit from my experiments. Have fun.

THIS IS BRILLIANT. THANKS!


Aaron Anderson (not verified) - 2009-11-09 14:47

This is brilliant. thanks!

I'VE BEEN TRYING THIS AND


Alex (not verified) - 2010-01-09 17:14

I've been trying this and variants thereof but when I try and do the Get-Wmiobject command I always get a 'Get-WmiObject : Invalid namespace' error. (querying against a Exchange 2007 server).

1 sur 2

02/07/2012 18:35

PowerShell - list Exchange 2003 mailbox information | Black Mountain


(querying against a Exchange 2007 server).

http://www.blkmtn.org/powershell-list-exchange2k3-mb-info

AWESOME....THANKS FOR THE


Anonymous (not verified) - 2010-02-16 11:04

AWESOME....Thanks for the info. would anyone know what i need to use to get the Exchange 2003 Storage Limits (Warning size, Prohibit send and receive) or just to see if the mailbox is over their limit?

POST IT ON
Joel "Jaykul" Bennett (not verified) - 2010-02-25 20:45

Post it on http://PoshCode.org -- The PoshCode script gives you tools for sharing/searching/downloading from inside PowerShell, it's a better experience! :)

2 sur 2

02/07/2012 18:35

Das könnte Ihnen auch gefallen