Printer Friendly Version      Send     
Click to Rate and Give Feedback
Related Articles
New Tip ...

Read more!

This Tip will explain how to send email from Exchange ...

Read more!

You know what ...

Read more!

This is teh descriptionBla ...

Read more!

Make a new tip by beating yourself in the head with a keyboard ...

Read more!

Popular Articles

Far too often, people who are not trained database administrators somehow end up responsible for a database. They lack the proper training and knowledge to maintain their database, and problems begin to develop. Here’s a primer for all those involuntary DBAs who need a crash course in database maintenance best practices.

Paul S. Randal

TechNet Magazine August 2008

...

Read more!

The introduction of Hyper-V makes virtualization an even more compelling solution for IT environments. Get an overview of today’s virtualization market and see how Hyper-V improves the manageability, reliability, and security of virtualization

Rajiv Arunkundram

TechNet Magazine October 2008

...

Read more!

Wikis offer a new, more flexible way to collaborate, promoting an unstructured approach to thinking and exchanging ideas. And MOSS 2007 makes it incredibly easy to implement wikis in your organization. Here’s what you need to know to start building and using wikis in the workplace.

Mauro Cardarelli

TechNet Magazine January 2007

...

Read more!

While User Account Control offers an important improvement in security, the ability to elevate permissions is essential for accomplishing certain administrative tasks and functions. Here are some Elevation PowerToys that make elevation more flexible and powerful.

Michael Murgolo

TechNet Magazine June 2007

...

Read more!

Shared and privileged account passwords are commonplace, but far too many organizations fail to adequately manage these shared passwords. This creates a serious security issue. Explore the risks involved with shared and privileged accounts, and discover better approaches to managing more secure passwords.

Chris Stoneff

TechNet Magazine September 2008

...

Read more!

Our Blog

Last year around this time, TechNet Magazine featured an article about the Microsoft Security Intelligence Report - a comprehensive study by the Microsft Malware Protection Center of the computer security landscape. Well, the latest SIR (volume 5) has just been released, and it's packed with a detailed analysis of current threats, as well as updates on available countermeasures. Head ...

Read more!

Have you ever wondered why you sometimes get a message that says Windows can't replace a file that is currently in use? In the November 2008 issue of TechNet Magazine, Raymond Chen looks at the underlying reason for this and explains why it would be more accurate to say Windows can but has chosen not to ...

Read more!

Have various workers in your company been showing up with questions about Macs? The odds of having a homogeneous network today are very unlikely. Macs are becoming increasingly popular and chances are if you don't already have some on your network, soon you will. 

Don't consider this a burden. This actually creates a fantastic opportunity for you as an IT professional. Instead of being an administrator who says "I don't ...

Read more!

Did you just go “whoa!” when you saw that title? Bet you never thought you’d see that here! But the times, as they say, are a-changing and we have too. Many organizations today use multiple operating systems. We all have the same goal of providing high-quality, cost-effective IT services to the organization, and one way we can do that is by sharing core software infrastructure like Active Directory. ...

Read more!

The latest installment of our online-only Sustainable Computing column is now available.

Find out how you can:

Bring Windows Server 2008 and Windows Vista Power Management Settings into Compliance Bring Windows Server 2003 and Windows XP Power Management Settings into Compliance Enforce Energy-Efficient Architectures ...

Read more!

Utility Spotlight WMI Code Creator
Chris Scoville

Download the code for this article: WMI Code Creator (122KB)

As a systems administrator you’re surely no stranger to Windows®Management Instrumentation (WMI), which gives you access to a wealth of management information and allows you to automate administrative tasks. To take full advantage of WMI you have to write queries to extract the information you need. And if you don’t have the ready-made queries already floating around in your head, you just might want to take the WMI Code Creator for a spin. It’s a recently released tool that generates custom code to use WMI so you can get the most from the myriad of computer management options that WMI has to offer.
The WMI Code Creator can generate code in VBScript, C#, and Visual Basic® .NET; you can run the code directly from the tool. You can generate code to query for management information, execute a management task, or receive event notifications.
For example, suppose you want to get a list of all the services running on a computer. You can use the WMI Code Creator to query for this information by selecting the WMI class you want to query (Win32_Service) and the properties that contain the information you are interested in accessing. And you can do more than just execute queries. Let’s say you want to start a service that isn’t running. You can use the WMI Code Creator to generate a script to do that too. All the code is generated for you based on a few selections you make. Plus, the tool contains step-by-step help to teach you how to use it to get the information you want.
The WMI Code Creator generates code that you can point at remote computers as well. You can query for the same kind of data you can get on local computers, receive event notifications, and even execute tasks remotely. All you need to do is enter the domain and name of the remote computer, and the code is generated automatically.
Figure 1 shows an example of event notification code generated by the WMI Code Creator. Note that you can set the frequency at which WMI should poll for the specified events, and you can edit or execute the code as well.
Figure 1 WMI Code Creator Generating Event Notification Code 
If you aren’t familiar with all of the WMI classes and their uses, the WMI Code Creator lets you browse through the available WMI classes on your computer, and displays descriptions of these classes, their properties, and methods. The WMI Code Creator also lets you quickly access the documentation for a WMI class by linking you to the specific class page in the MSDN® WMI documentation online.
The WMI Code Creator download also includes the source code, which serves as a really handy tool for learning how to use the System.Management classes in the Microsoft® .NET Framework to access WMI. The tool was built using WMI, and the source code provides many examples for how to use WMI to add functionality to an application.
Use the tool to open up a world of WMI functionality and all the computer management possibilities it provides. It will save you time writing administrative scripts and code, and provide you with excellent examples and solutions. You can download the utility from WMI Code Creator.

Chris Scoville is a programming writer in the Windows Server Developer Documentation group at Microsoft. He writes documentation and code examples for management technologies. He developed the WMI Code Creator tool.  Chris can be reached at chscovil@microsoft.com
© 2008 Microsoft Corporation and CMP Media, LLC. All rights reserved; reproduction in part or in whole without permission is prohibited.
Page view tracker