How to Create a Class
You can use the following VBScript code sample to add a new Class object to the IIS ADSI Schema. To create a Class object, follow these steps:
- Bind to the Schema container.
- Create a new Class object.
- Write the new Class object to the metabase.
Example: Creating a new Class object.
' Get the parameters for the machinename
Dim ArgObj
Set ArgObj=WScript.Arguments
MachineName = ArgObj.Item (0)
ClassName = ArgObj.Item (1)
' Bind to the Schema container object.
Dim SchemaObj
Dim NewClassObj
Set SchemaObj = GetObject ("IIS://" & MachineName & "/Schema")
' Create a new Class object for ClassName.
Set NewClassObj = SchemaObj.Create ("Class", ClassName)
' Write the new Class object to the metabase.
NewClassObj.SetInfo
Related Topics
- For more examples, see How to Create a Property and How to Add Properties to a Class.