The following VBScript code sample can be used to add a new Property object to the IIS ADSI Schema. To create a Property object, follow these steps:
Syntax value | Description |
Boolean | Boolean variable (should be TRUE or FALSE). |
Integer | 32-bit signed integer. |
String | Null-terminated string. |
ExpandSz | Double null-terminated list of strings. |
List | Array of null-terminated strings. |
IPSec | IPSecurity data type. |
NTAcl | Windows access control list. |
MimeMapList | Array of MimeMap objects. |
''''''''''''''''''''''''''''
' Get the parameters for the machine name.
Dim MachineName
Dim PropertyName
Dim ArgObj
Set ArgObj=WScript.Arguments
MachineName = ArgObj.Item (0)
PropertyName = ArgObj.Item (1)
' Bind to the Schema container object.
Dim SchemaObj
Dim NewPropertyObj
Set SchemaObj = GetObject ("IIS://" & MachineName & "/Schema")
' Create a new Property.
Set NewPropertyObj = SchemaObj.Create ("Property", PropertyName)
' Set the syntax of the object.
' The default syntax is String.
' The syntax must be set before calling SetInfo.
NewPropertyObj.Syntax = "string"
' Write NewPropertyObject to the metabase.
NewPropertyObj.SetInfo
' Set the NewPropertyObject's attributes by inheritance.
NewPropertyObj.Inherit = True
' Write NewPropertyObject to the metabase.
NewPropertyObj.SetInfo
For more examples see How to Create a Class and How to Add Properties to a Class.