![]() |
|
|
| Become a Columnist Microsoft Exchange Site Microsoft Support SiteMSDN Exchange Site | ||
|
|
Managing Exchange 2000/2003 using PowerShell
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.
|
|||||||
|
|
| |||||||
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 Pro Exchange. OutlookExchange.Com 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 Pro Exchange, Inc., 2006