Reading Help Files
One of my earliest uses of PowerShell was to get information through WMI queries on our Exchange 2003 servers. It worked and gave us the information I needed. Recently I came across a post from Don Jones on reading the PowerShell help files more closely. He's right you should.
The new script seems faster as well. I should probably look at those performance test cmdlets the MVPs all run from time to time to see if it's a real performance kick or subjective.
# Gets data through WMI from specified Exchange mailbox servers
$computers = "server001","server002"
Get-Wmiobject -namespace root\MicrosoftExchangeV2 -class Exchange_Mailbox -computer $computers | sort-object -desc MailboxDisplayName | select-object MailboxDisplayName,StorageGroupName,StoreName,SizeCompare it to my original code.
Of course, it probably helps if you're a better script writing then I am and have a better understanding of all the jargon you're reading, but this is why I like the blogs, you generally learn something often enough that really helps out later.

Theme by
Post new comment