Hey, Scripting Guy! I liked your articles about how to get a list of the installed device drivers. However, I want to get a list of all drivers available for installation in the Windows Vista driver store (in other words, a list of hardware supported, which might be several per driver). All I can find is a WMI class that does this on a Systems Management Server. Is it possible to make this information available to other computers?

-- DV

Hello DV,

Microsoft Scripting Guy Ed Wilson here. All drivers that are available to a computer are in the system root folder. Printer drivers all begin with the letters “prn”. Using this information, I can easily get a list of the available printer drivers by using the Get-ChildItem cmdlet and piping the results to the Where-Object cmdlet. This is shown here.

Hey Scripting Guy! I found that you can query Internet Information Server (IIS) via WMI, but you must install something separate. I have seen some of the basic things that people have asked you about IIS, but I am looking to see if webDAV is enabled. I could not find anything on Web service extensions.

-- PJ

Hello PJ,

Actually, IIS has long been queriable via WMI. For IIS in Windows Server 2008 R2, there are four options:

1.You can use the “classic” WMI. They are the same WMI classes that were available in Windows Server 2003. When you add the IIS role, you choose IIS 6 management compatibility.

2.In Windows Server 2008, there are new WMI classes. These are an additional check box, and are called IIS management Scripts and Tools.

3.There are IIS cmdlets. The IIS page has extensive information about using these.

4.There is a WinRM IIS Extension that can be added as a feature.

These options are configured via the Server Manager utility, as seen here:

If you are interested in using Windows PowerShell and WMI to manage your IIS Server, I have a chapter in the Microsoft Press Windows PowerShell Scripting Guide book that covers this topic.

<

p style="MARGIN: 0in 0in 8pt" class="MsoNormal">

Tell Me More About Querying WMI Objects

Hey, Scripting Guy! I have noticed that there are multiple ways to query a WMI object. I can use filter, query, where, and select. What is the difference? Does it depend on what you are querying, and is one faster than the other?

-- EJ

Hello EJ,

There are many ways of querying a WMI object. The one I use is the one that pops to mind at the time. If I am working interactively at the Windows PowerShell console, I will often use the alias for the Get-WmiObject cmdlet and the class parameter in the first position without naming the parameter. This is shown here:

Gwmi WIN32_bios

Using the gwmi alias and the WMI class name is faster than spelling out the gwmi alias with the –query parameter. This is seen here:

gwmi –query “Select * from WIN32_bios”

From a results standpoint, both the –query parameter and the -class parameter return the same objects.

At times, however, I need to use a particular method or functionality because of what I am doing. In general, I would say you should use the syntax that feels natural. When working at the Windows PowerShell command line, I almost never use the –query parameter anymore. I instead use –class filter. I seldom use –property to filter out properties; instead, I generally return the entire object and deal with it in the output in the pipeline. Here are examples of that:

As you can see from the two commands above, the second output is much cleaner. Because of the way that Windows PowerShell returns the system properties as well as the specific property requested in the –property parameter, I always use the second syntax.

Tell Me More About the WMI Shadow Copy Class

Hey Scripting Guy! I need to collect the Volume Shadow Copy configuration status for more than 500 servers.My requirement is to find out which disk has Visual Source Safe (VSS) enabled. Could you help me? I have tried theList All Shadow Copies on a Computerscript, and it is giving the output seen here:

By using the above output, I see that one drive has VSS enabled. However, it does not clearly tell me which drive has VSS enabled. Can you help me?

-- GK

Hello GK,

MSDN documents the WMI shadow copy class. If your volume name is not visible, due to it being hidden, you will need to query theWin32_ShadowVolumeSupportassociation class.

Troubleshooting an HTA Script

Hey, Scripting Guy! I am trying to create an HTA script that will allow me to use standard Open/Save dialog boxes, so that the client computer can browse for a file or folder and select it, passing the selected item back to my HTA script for processing. This project sounded simple enough. I know that this could be done under Windows XP, but all our machines are currently running Windows Vista.