Trouble adding dynamic sub-domain
I am having a problem adding subdomains dynamically through a web site that I am building. I have full control of the windows server that I am on.
Here is the error I am getting.
SWbemLocator error '80041003'
Access denied
/subdomain_add.asp, line 16
Here is my coce
<%
' User Data
strUserID="bob"
strServer="H180284"
strRoot="c:\Inetpub\wwwroot\"
strDomain=".mydomain.com"
' Create Users Folder
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.CreateFolder(strRoot&strUserID)
' Setup Connections To IIS
set locatorObj = CreateObject("WbemScripting.SWbemLocator")
set providerObj = locatorObj.ConnectServer(strServer,"root/MicrosoftIISv2")
set serviceObj = providerObj.Get("IIsWebService='W3SVC'")
' Set Site Data
Bindings = Array(0,0)
Set Bindings(0) = providerObj.get("ServerBinding").SpawnInstance_()
Bindings(0).IP = ""
Bindings(0).Port = "80"
Bindings(0).Hostname = strUserID&strDomain
Set Bindings(1) = providerObj.get("ServerBinding").SpawnInstance_()
Bindings(1).IP = ""
Bindings(1).Port = "80"
Bindings(1).Hostname = "www."&strUserID&strDomain
'Create & Start Site
strSiteObjPath = serviceObj.CreateNewSite(strUserID, Bindings, strRoot&strUserID)
Set objPath = CreateObject("WbemScripting.SWbemObjectPath")
objPath.Path = strSiteObjPath
strSitePath = objPath.Keys.Item("")
Set serverObj = providerObj.Get(strSiteObjPath)
serverObj.Start
%>
What am I doing wrong here? how do I give access to the internet guest account?
Thanks a bunch in advance,
Kharron
|