Share via


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:

  1. Bind to the Schema container.
  2. Create a new Class object.
  3. 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