IIsSetting (WMI)
The IIsSetting class allows you to query for a setting without knowing its type. A query for IIsSetting = 'W3SVC/1' returns any instance of a subclass under CIM_Setting that has its Name property set to 'W3SVC/1', or in other words, any CIM_Setting subclass that is associated with 'W3SVC/1'.
Methods
The IIsSetting object has no methods.
Properties
The IIsSetting object defines the following property, in addition to those inherited from CIM_Setting (WMI).
Property |
Data type |
Description |
---|---|---|
Name |
String |
The Name property defines the label by which the object is known. When subclassed, the Name property can be overridden to be a Key property. |
Example Code
The following JScript code illustrates how to use the IIsSetting class to enumerate all possible setting classes for a given metabase node.
o = getobj("winmgmts:/root/microsoftiisv2")
nodes = o.ExecQuery("select * from IIsWebServerSetting where name='w3svc/1'")
e = new Enumerator(nodes)
for(; ! e.atEnd(); e.moveNext()) {
WScript.Echo(e.item().Name + " (" + e.item().Path_.Class + ")")
}
// The output should be:
// w3svc/1 (IIsWebServerSetting)
nodes = o.ExecQuery("select * from
IIsSetting where name='w3svc/1'")
e = new Enumerator(nodes)
for(; ! e.atEnd(); e.moveNext()) {
WScript.Echo(e.item().Name + " (" + e.item().Path_.Class + ")")
}
// The output should be:
// w3svc/1 (IIsIPSecuritySetting)
// w3svc/1 (IIsWebServerSetting)
Requirements
Server: Requires or Windows Server 2003.
Product: IIS