M
Martin c
Hi all. (please excuse the cross post, I'm none too sure where to pitch this
question)
I'm trying to write some ASP.NET to create a web site on a server form a
given set of variables, and found seom code on teh internet that does
roughly what i need. (http://www.panayot.com/articles/iis.htm) but is a
little too long winded. Between that and a C# example
(http://weblogs.asp.net/jezell/archive/2003/09/17/27869.aspx) i'm definately
starting to make prorgess.
Unfortuantely though, i am revieving the follwoing error:
"The value provided for adsObject does not implement IADs."
from the following line:
dim iisroot as new
directoryentry(cType(iisObj.invoke("Create","IIsWebServer",txtID),DirectoryE
ntry))
Does anyone know how i can fix that problem, The internet seems blank on the
subject.
T.I.A
Martin
function addSite(txtid, txtDom)
' 1) Connect to Server root
dim iisObj as new Directoryentry("IIS://Localhost/W3SVC")
' 2) Create IIsWebServer Object
dim iisroot as new
directoryentry(cType(iisObj.invoke("Create","IIsWebServer",txtID),DirectoryE
ntry))
iisroot.Invoke("Put","ServerComment",txtDom)
iisroot.Invoke("Put","KeyType", "IIsWebServer")
iisroot.Invoke("Put","ServerBindings",":80:")
iisroot.Invoke("Put","ServerState",2)
iisroot.Invoke("Put","FrontPageWeb",0)
iisroot.Invoke("Put","ServerAutoStart",1)
iisroot.Invoke("SetInfo")
' 3) Create vRoot 'Root'
iisweb = iisRoot.Children.Add("Root", "IIsWebVirtualDir")
iisWeb.Properties("AppIsolated")(0)=2
iisWeb.Properties("Path")(0)="D:\Intetpub\wwwroot"+getpath(txtDom)
iisWeb.Properties("AccessFlags")(0)=513
iisWeb.Properties("AppRoot")(0)="LM/W3SVC/"+txtID+"/Root"
iisWeb.CommitChanges()
iisRoot.CommitChanges()
' 4) Return
addSite="Created Web site for "+txtDom+" at instance "+txtID
end function
question)
I'm trying to write some ASP.NET to create a web site on a server form a
given set of variables, and found seom code on teh internet that does
roughly what i need. (http://www.panayot.com/articles/iis.htm) but is a
little too long winded. Between that and a C# example
(http://weblogs.asp.net/jezell/archive/2003/09/17/27869.aspx) i'm definately
starting to make prorgess.
Unfortuantely though, i am revieving the follwoing error:
"The value provided for adsObject does not implement IADs."
from the following line:
dim iisroot as new
directoryentry(cType(iisObj.invoke("Create","IIsWebServer",txtID),DirectoryE
ntry))
Does anyone know how i can fix that problem, The internet seems blank on the
subject.
T.I.A
Martin
function addSite(txtid, txtDom)
' 1) Connect to Server root
dim iisObj as new Directoryentry("IIS://Localhost/W3SVC")
' 2) Create IIsWebServer Object
dim iisroot as new
directoryentry(cType(iisObj.invoke("Create","IIsWebServer",txtID),DirectoryE
ntry))
iisroot.Invoke("Put","ServerComment",txtDom)
iisroot.Invoke("Put","KeyType", "IIsWebServer")
iisroot.Invoke("Put","ServerBindings",":80:")
iisroot.Invoke("Put","ServerState",2)
iisroot.Invoke("Put","FrontPageWeb",0)
iisroot.Invoke("Put","ServerAutoStart",1)
iisroot.Invoke("SetInfo")
' 3) Create vRoot 'Root'
iisweb = iisRoot.Children.Add("Root", "IIsWebVirtualDir")
iisWeb.Properties("AppIsolated")(0)=2
iisWeb.Properties("Path")(0)="D:\Intetpub\wwwroot"+getpath(txtDom)
iisWeb.Properties("AccessFlags")(0)=513
iisWeb.Properties("AppRoot")(0)="LM/W3SVC/"+txtID+"/Root"
iisWeb.CommitChanges()
iisRoot.CommitChanges()
' 4) Return
addSite="Created Web site for "+txtDom+" at instance "+txtID
end function