The Benefits of WMI in Exchange
Posted 4/28/2004
As many of you know, Windows Management Instrumentation or WMI for short, offers administrators a very robust way of configuring and analyzing system performance and settings. WMI contains the power to access an almost endless array of settings and configurations, as well as facilitates monitoring and configuration of settings. What many of you may not know is that since Exchange 2000 sp2, Exchange contains many WMI features as well. This enables the Exchange administrator the ability to create tools that are tailored to their network. Let us take a look at some examples of how WMI can streamline some of your administrative tasks.
In this article I’m not even going to begin to explain all the classes and give examples of each; however I would like to give some background as to why they may be right for your particular network and give some examples to show the ease of administration they can provide.
Before hammering out a script and firing it of there is something you need to remember. WMI is a very powerful and flexible tool that can really wreak havoc on a system when ill configured. It is recommended that you only test scripts in a non-production environment. Furthermore, WMI concepts can be hard to grasp at times and a thorough explanation of its functions and scripting options can be found at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_start_page.asp.
WMI has many benefits for any situation. From just the operating system standpoint, WMI offers useful administration tasks. For example with a script like Script 1, administrators could enumerate each account on the specified machine and display name, SID, SID type, status, and account type of each user. Furthermore, administrators could monitor CPU status and memory usage on each machine in the network.
Since Exchange 2000 sp2, WMI has been a path of information about various aspects of the overall Exchange performance. WMI in the Exchange 2000 sp2 flavor, allows administrators to find information about queues, connector states, and cluster performance. For example in script 2, we can check each connector and find out if it is running or not. Script 3 upgrades the basic functionality of script 2 to a more useful tool where, when a connector is down, an email can be sent directly to you. You may then setup the script on a schedule and periodically check for connector performance. Additionally, the script could be altered create a log file of other Exchange performance during the connector problem such as queue size and states.
Exchange 2003 provides many new features as well as improves on existing features and this is true of Exchange’s WMI as well. Nineteen new classes have been added to Exchange 2003, four of which are old classes with new features. Backwards compatibility is also available in the 2003 server. This provides an even more robust way for Exchange administrators to gain valuable information about their systems. For example, you may use the new Exchange_Server class in conjunction with the new Exchange_Mailbox class (script 4) to get a report on mailbox size in each server. Additionally, you may find the need to shut the server down and need to notify each user that is currently logged in to disconnect from Exchange. You can choose to use the new Exchange_Logon class to quickly run a report that displays and/or logs the users that are currently logged on as done in script 5. In addition this class gives such information as adapter speed, reporting on the speed of the connection in which the client is connected and latency, which gives the server response latency time as reported by the client. It also reports the client’s IP address, MAC address, the number of successful RPC requests made by the client, and even the client mode to report whether the client is using “classic mode” or “cached mode.” Given this additional information we could determine certain servers where latency was a problem (script 6), and move mailboxes around to better ‘balance’ the system.
I have only begun to scratch the surface on the power and benefits WMI in Exchange holds. The benefits of WMI in the Exchange environment are truly endless, but the main advantage is time. When you become familiar with the WMI, you can quickly write out a script to handle just about any administration task you need. Moreover, you can schedule checks to run daily, hourly, or even by the minute to keep you informed of misbehaving equipment, which in turn may give you a head start before the big crash becomes a reality. Too often is the time where subtle hits may lead a major catastrophe. I’m convinced that coupling WMI with your current administration will lead to more time for what’s important, a game of Solitaire.
You can download a complete zip file of all the scripts contained in this article here.
|