473,406 Members | 2,894 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

IADs, adsObject and other stories

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/archiv.../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","IIsWe bServer",txtID),DirectoryE
ntry))

Does anyone know how i can fix that problem, The internet seems blank on the
subject.

T.I.A
Martin
>>Full Code<<<<<<<

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","IIsWe bServer",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
Jul 19 '05 #1
1 3593
Hi Martin,

Thank you for using the community. As I understand, you want to create a
web site and virtual directory with the code.

From the C# sample you mentioned:

DirectoryEntry root = new DirectoryEntry("IIS://localhost/W3SVC");

...
// Create web site
DirectoryEntry site = (DirectoryEntry)root.Invoke("Create", "IIsWebServer",
siteID);

As you see, first we get the IIS root object ("iisObj" in your code), and
then create/find the site object. The site object is also a DirectoryEntry.
Therefore, I think your code should be:

dim iisrootsite as
directoryentry=cType(iisObj.invoke("Create","IIsWe bServer",txtID),DirectoryE
ntry)

instead of

dim iisroot as new
directoryentry(cType(iisObj.invoke("Create","IIsWe bServer",txtID),DirectoryE
ntry))

The Constructor of DirectoryEntry:

public DirectoryEntry(
object adsObject
);

Will accept an adsObject as parameter, not a DirectoryEntry. This is the
source of orginal error.

Hope this help,

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: John Beardsworth | last post by:
Hi I'm customising phpNuke as an intranet application. The client would like the option of letting users post news stories without administrators' approval, so I've added a function to the...
0
by: Stephan Deibel | last post by:
Hi, I just wanted to let y'all know that the Python Success Stories collection has nine new additions: http://www.pythonology.com/success These 28 stories include significant testimonials...
0
by: Stephan Deibel | last post by:
Hi, O'Reilly Associates is going to be printing volume III of the Python Success Stories series in June and I'm looking for submissions of new stories. The stories have been quite valuable...
0
by: Petrone | last post by:
And so are the success stories. Munich, Germany's recently disclosed plans to move off Windows to Linux on the desktop is the most high profile large-scale migration, but there are many...
1
by: jurgen oerlemans | last post by:
Hello, I want to manage printqueues and their jobs and think I can use IADSPrintQueue and IADS PrintJobs for this. If I use dim pq as IADSPrintQueue I get the eror message Type 'IADSPrintQueue...
1
by: Martin c | last post by:
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...
1
by: gaikokujinkyofusho | last post by:
Hi, I have been enjoying being able to subscribe to RSS (http://kinja.com/user/thedigestibleaggie) for awhile and have come up with a fairly nice list of feeds but I have run into an annoying...
3
by: noize | last post by:
I have found other bugs related to using hover is CSS with IE, but I cannot find a fix for my issue. I have checked it in both IE 6 & 7 with the same results. I have built a drop-down menu using...
0
by: jayabarathi2007 | last post by:
Romance stories details........................ Romance stories details........................ Romance stories details........................ http://geocities.com/unisebus/ ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.