i=1
%>
<table border=1>
<tr><th>Class Must Have Property</th>
<th>Default Web Site Current Value</th></tr>
<%
i=1
For Each Thing in asMustHaves
Response.Write "<tr><td>("& Cstr(i) & ") " &_
Thing & "</td><td>" &_
IISObject.Get(Thing) & "</td></tr>"
i = i + 1
Next
%>
</table>
<br>
<table border=1>
<tr><th>Class May Have Property</th>
<th>Default Web Site Current Value</th></tr>
<%
i=1
For Each Thing in asMayHaves
Response.Write "<tr><td>("& CStr(i) & ") " &_
Thing & "</td><td>" &_
IISObject.Get(Thing) & "</td></tr>"
i = i + 1
Next
%>
</table>
'Get Default Web Site Object
set websvc = GetObject("IIS://" & sComputer & "/W3svc/1")
'Verify by printing out ServerComment
Response.Write "Comment = " & websvc.ServerComment & "<br>"
'Get root of Default Web Site
set vRoot = websvc.GetObject("IIsWebVirtualDir", "Root")
'Get Class Definition of virtual directory
Set ClassDefinition = GetObject(vRoot.Schema)
'Get list of mandatory properties
asMustHaves = ClassDefinition.MandatoryProperties
'Get list of optional properties
asMayHaves = ClassDefinition.OptionalProperties
i=1
%>
<table border=1>
<tr><th>Class Must Have Property</th>
<th>Root Virtual Directory Current Value</th></tr>
<%
on error resume next
For Each Thing in asMustHaves
Response.Write "<tr><td>("& Cstr(i) & ") " &_
Thing & "</td><td>" & vRoot.Get(Thing) &_
"</td></tr>"
i = i + 1
Next
%>
</table>
<br>
<table border=1>
<tr><th>Class May Have Property</th>
<th>Default Web Site Current Value</th></tr>
<%
i=1
For Each Thing in asMayHaves
Response.Write "<tr><td>("& CStr(i) & ") " &_
Thing & "</td><td>" & vRoot.Get(Thing) &_
"</td></tr>"
i = i + 1
Next
on error goto 0
'Create Virtual Directory
'Param 1 is class name
'Param 2 is the new object name
Set vDir = vRoot.Create("IIsWebVirtualDir",sVirDir)
'Only setting two properties
vDir.AccessRead = true
vDir.Path = sPhyDir
'Write information back to Metabase
vDir.SetInfo
%>