Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:17 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.