Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old February 26th, 2009, 08:42 PM
Registered User
 
Join Date: Feb 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creation of dynamic LinkButton and Adding Event sonaldewle General .NET 2 April 14th, 2006 06:49 AM
dynamic adding image to crystal report ywchan Crystal Reports 3 February 16th, 2005 09:48 AM
Adding dynamic fields ivnavin Crystal Reports 0 December 17th, 2004 03:35 PM
Adding dynamic input stephanel Javascript 4 February 20th, 2004 07:06 AM
trouble adding new record TnTandyO Classic ASP Databases 1 November 4th, 2003 02:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.