Posts Tagged ‘Snipits’
Create Multiple Web Sites on XP Version of IIS
Saturday, September 30th, 2006
‘ Create an instance of the virtual directory object
‘ that represents the default Web site.
Set IIsWebVDirRootObj = GetObject(“IIS://localhost/W3SVC/1/Root”)
‘ Use the Windows ADSI container object “Create” method to create
‘ a new virtual directory.
Set IIsWebVDirObj = IIsWebVDirRootObj.Create(“IIsWebVirtualDir”, “NewVDir”)
‘ Use the Windows ADSI object “Put” method to
‘ set some required properties.
IIsWebVDirObj.Put “Path”, “C:\NewContent”
IIsWebVDirObj.Put “AccessRead”, True
IIsWebVDirObj.Put “AccessScript”, True
‘ Use the AppCreate2 method of the IIS ADSI provider to
‘ create an application on the new virtual directory.
IIsWebVDirObj.AppCreate2 1
IIsWebVDirObj.Put “AppFriendlyName”, “NewApp”
‘ Use the Windows ADSI object “SetInfo” method to
‘ save the data to the metabase.
IIsWebVDirObj.SetInfo
‘ Create an instance of the virtual directory object
‘ that represents the default Web site.
Set IIsWebVDirRootObj = GetObject(“IIS://localhost/W3SVC/1/Root”)
‘ Use the Windows ADSI container object “Create” method to create
‘ a new virtual directory.
Set IIsWebVDirObj = IIsWebVDirRootObj.Create(“IIsWebVirtualDir”, “NewVDir”)
‘ Use the Windows ADSI object “Put” method to
‘ set some required properties.
IIsWebVDirObj.Put “Path”, “C:\NewContent”
IIsWebVDirObj.Put “AccessRead”, True
IIsWebVDirObj.Put “AccessScript”, True
‘ Use the AppCreate2 method of the IIS ADSI provider to
‘ create an application on the new virtual directory.
IIsWebVDirObj.AppCreate2 1
IIsWebVDirObj.Put “AppFriendlyName”, “NewApp”
‘ Use the Windows ADSI object “SetInfo” method to
‘ save the data to the metabase.
IIsWebVDirObj.SetInfo