Become a Columnist Microsoft Exchange Site Microsoft Support SiteMSDN Exchange Site

   

Subscribe to OutlookExchange
Anderson Patricio
Ann Mc Donough
Bob Spurzem
Brian Veal
Catherine Creary
Cherry Beado
Colin Janssen
Collins Timothy Mutesaria
Drew Nicholson
Fred Volking
Glen Scales
Goran Husman
Guy Thomas
Henrik Walther
Jason Sherry
Jayme Bowers
John Young
Joyce Tang
Justin Braun
Konstantin Zheludev
Kristina Waters
Kuang Zhang
Mahmoud Magdy
Martin Tuip
Michael Dong
Michele Deo
Mitch Tulloch
Nicolas Blank
Pavel Nagaev
Ragnar Harper
Ricardo Silva
Richard Wakeman
Russ Iuliano
Santhosh Hanumanthappa
Steve Bryant
Steve Craig
Todd Walker
Tracey J. Rosenblath
 
 

Managing Exchange 2000/2003 using PowerShell - Part 1

Page 1

Managing Exchange 2000/2003 using PowerShell

Managing Exchange 2000/2003 using PowerShell - Part 2
Managing Exchange 2000/2003 using PowerShell - Part 3

Most folks I talk to have installed PowerShell, but not done much with it. Most of these folks also run Exchange 2000 or Exchange 2003 and don't dream of managing Exchange from anything else but the GUI or VBScript.

Point in case, a lot of Exchange 2003 information is available via WMI. PowerShell makes WMI information rapidly accessible via the Get-WMiObject, or it's alias gwmi. Aliases are a shortened version of a command and are interchangeable. Makes for quicker typing.

Lets look at an example:

I'm going to attach to my local Exchange server and retrieve the list of available queues. Once I have those, I'll ask the results to be formatted into a table, and only return the headings  I want. My local server's name is 2003server. Don't forget to change that to be the Exchange server in question. Get-WmiObject has a short name of gwmi. Either may be used interchangeably.

Here's the command line.

Get-WmiObject ExchangeQueue -Namespace "root\cimv2\applications\exchange" -ComputerName 2003server | Format-Table VirtualMachine, LinkName, QueueName, NumberofMessages

If you like that, but don't like the format, then you change the format of the output to be a list as opposed to a table by piping to Format-List instead of Format-Table. Try it or try copying the code below:

Get-WmiObject ExchangeQueue -Namespace "root\cimv2\applications\exchange" -ComputerName 2003server | Format-List VirtualMachine, LinkName, QueueName, NumberofMessages

If you liked this article and would like to see more about PowerShell and Exchange, then check out BlankMan’s blog (that’s me) on http://blankmanblog.spaces.live.com/. Please also leave me a comment on what you do and don’t like.

Managing Exchange 2000/2003 using PowerShell - Part 2
Managing Exchange 2000/2003 using PowerShell - Part 3

Managing Exchange 2000/2003 using PowerShell - Part 1

Nicolas Blank Page 1


Disclaimer: Your use of the information contained in these pages is at your sole risk. All information on these pages is provided "as is", without any warranty, whether express or implied, of its accuracy, completeness, fitness for a particular purpose, title or non-infringement, and none of the third-party products or information mentioned in the work are authored, recommended, supported or guaranteed by Stephen Bryant or Pro Exchange. OutlookExchange.Com, Stephen Bryant and Pro Exchange shall not be liable for any damages you may sustain by using this information, whether direct, indirect, special, incidental or consequential, even if it has been advised of the possibility of such damages.

Copyright Stephen Bryant 2008