Utility SpotlightGroup Policy Inventory

Greg Steen

Download the code for this article: GPInventory.exe (150KB)

HOW DO YOU know what you have if you don’t keep track of it? Having inventory details at your fingertips can save you lots of headaches when budget allocation meetings and yearly audits roll around. And, of course, the powers-that-be always seem to want to know who has what and why, and what it will take to do that major upgrade.

A tool that can help you with all this is Group Policy Inventory (GPInventory.exe), included with the Windows Server® 2003 Resource Kit. This program lets you query and retrieve system information with Resultant Set of User Policy (RSOP) and/or Windows® Management Instrumentation (WMI) queries from multiple remote hosts, as the figure shows. Not surprisingly, the program easily retrieves Group Policy information, but it’s also an effective means for pulling out detailed system information such as applications that have been installed, the processor name and speed, or the list of installed hotfixes. But wait, there’s more! Since it’s part of the Windows Server 2003 Resource Kit, it’s 100 percent free.

Figure 1 Using GPInventory to Gather Information

Figure 1** Using GPInventory to Gather Information **(Click the image for a larger view)

There are many different ways to put GPInventory.exe to use. For example, if you need to verify warranty status, you can collect the serial or service numbers of the PCs on your network without having to truck out to every box. Or, if you have a lab environment and you want to see if a machine is currently in use, you could query the users currently logged onto the system without getting out of your chair. If you have a blade server set up where images are blown down to the blades on a routine basis (to clean out and restore your QA environment, for example), you could query the install date of the PC to verify when the last image was applied.

GPInventory is also quite easy to use. You point it to a file that has a list of computers you want to inventory, select which queries to run, and then process the list. The tool then reaches out and connects to each computer on the list and queries it. If you are doing a quick query, you can also select the target machines directly from Active Directory® and the query actions to perform from the Query menu.

To run an RSOP query on a machine, you’ll need to have the Generate Resultant Set of Policy (logging) permission (which domain admins and delegated admins have by default). WMI queries require Administrative rights on the remote machine unless you use the WMI Control MMC snap-in to grant Enable Account and Remote Enable rights on the root\cimv2 namespace to an alternate user.

Once you’ve run your query, you can save the results as a tab-delimited text file or as XML. Both varieties can be imported into Microsoft® Excel® for analysis. You can sort and then apply an auto-filter to find all the details.

GPInventory also supports command-line execution, so you could easily set up a scheduled task to query system information and save it to an XML file directly, without GUI intervention. This can be very useful for long-running queries that are better suited for off-hours execution.

The tool comes with a default set of RSOP and WMI queries, but you can add, edit, and update the query file with your own customized list if what you need isn’t there. The included help document shows you how to define a new query in the query-list XML file.

GPInventory.exe is a great way to gather information on the machines running Windows across your network, whether for inventory, group policy, or status information. You’ll find a link to the Group Policy Inventory tool in the downloads section of our Web site.

Greg Steen is a technology professional, entrepreneur, and enthusiast. He is always on the hunt for new tools and methods to help make operations and development easier for IT professionals.

© 2008 Microsoft Corporation and CMP Media, LLC. All rights reserved; reproduction in part or in whole without permission is prohibited.