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,Size

Compare 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.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h3> <blockquote> <img>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options