Para aquéllos que les gusta probar de todo, les dejamos el código siguiente para testarlo.

asp-net

<% 

‘ User DatastrUserID=»bob»strServer=»server»strRoot=»c:\inetpub\wwwroot\»strDomain=».somedomain.com» 

‘ Create Users FolderSet fso = CreateObject(«Scripting.FileSystemObject»)Set f = fso.CreateFolder(strRoot&strUserID) 

‘ Setup Connections To IISset locatorObj = CreateObject(«WbemScripting.SWbemLocator») set providerObj = locatorObj.ConnectServer(strServer,»root/MicrosoftIISv2″)set serviceObj = providerObj.Get(«IIsWebService=’W3SVC'»)  

‘ Set Site DataBindings = Array(0,0)Set Bindings(0) = providerObj.get(«ServerBinding»).SpawnInstance_()Bindings(0).IP = «»Bindings(0).Port = «80»Bindings(0).Hostname = strUserID&strDomainSet Bindings(1) = providerObj.get(«ServerBinding»).SpawnInstance_()Bindings(1).IP = «»Bindings(1).Port = «80»Bindings(1).Hostname = «www.»&strUserID&strDomain 

‘Create & Start SitestrSiteObjPath = serviceObj.CreateNewSite(strUserID, Bindings, strRoot&strUserID)Set objPath = CreateObject(«WbemScripting.SWbemObjectPath»)objPath.Path = strSiteObjPathstrSitePath = objPath.Keys.Item(«»)Set serverObj = providerObj.Get(strSiteObjPath)serverObj.Start 

%>

Via: recortex.com