Powershell: how to query AD and share mailbox sizes

I recently learned that Exchange2007 will no longer support WMI, namely the service that \ ROOT \ MicrosoftExchangeV2 uses. An old script I wrote will output the ServerName, StorageGroupName, Storename, MailboxDisplayName, Size, TotalItems, DeletedMessageSizeExtended fields to a csv text file.

How will I go about doing this in Powershell?

I found that you can do this in the Exchange 2007 Management Console running Get-MailboxStatistics | FT Database, DisplayName, ItemCount, TotalItemSize | out-file textfile1.txt

which generates some of the exchange fields. HOw am I going to generate the rest of the Active Directory fields like Description and Office fields found in the active directory for the same user in the Exchange database and output it to a txt file?

0


source to share


4 answers


And BTW ... depending on how you want to format this information, it might be better to write a function that gets the user information and then the Exchange information and then concatenates them together into a custom object. PowerShell can then take care of outputting and formatting it in various ways for you. My PowerShell column at http://technet.microsoft.com/en-us/magazine/dd228985.aspx goes exactly like this: combining information from multiple places into a consolidated output. I also have some blog posts on the subject (see "evolution" in a search, I think) at ConcentratedTech.com.



+1


source


The Quest PowerShell cmdlets (quest.com/powershell) are probably the best way to go. You can use Get-QADUser -IncludeAllProperties to get all AD attributes for a user, including Office, Description, etc. Keep in mind that this is AD that has this information, not Exchange.



The Exchange cmdlets (Get-Mailbox) will get a certain amount of information for you, but the Exchange cmdlets really only focus on the Exchange bits as much as possible.

0


source


You can also use the Exchange User cmdlet to get a partial listing of the properties for an AD user:

PS> get-user | get member

0


source


I understood that.

Its something simple like this

Get-User | select name, office

0


source







All Articles