You can get a list of classes by googling Microsoft.Web.Administration and selecting an offering from msdn.microsoft.com
Thank you, but that does not list the service as it appears on my computer / server nor does it help me to figure out how to code the createobject capture that I need. I've been staring at that damn msdn article / series and a million other articles about Microsoft.Web.Administration but none of them give me the answer and I've tried but I cannot figure it out myself. Thanks, but I need hand holding this time...
You could always take another approach. What did you used to be able to do with IIS 6 that you can't do with IIS 7?
In IIS6 I was using the metabase with a variety of exe and vbs files.
In IIS7 I want to take advantage of the XML structure. I could probably use AppCMD but that seems so old school. I'd prefer to use the API and, in my mind, do it correctly and likely much more efficiently.
I just don't know how to list the services that are outside of Cold Fusion. ColdFusion Builder doesn't show them to me and I can't find a copy of OLEVIEWER to download, so I'm having trouble peeking under the hood.
I've tried so many variations on trying to make an object out of Microsoft.Web.Administration.dll that my fingers are numb and my eyes are bleeding. I don't know why I can't find any specific instance on the web of someone doing this with ColdFusion; it's weird, frankly.
To me, it's a simple question that SOMEONE out there must have answered by now. Knowing the name of an object on your computer, how do you create a CFObject out of it so you can use the services? But that's probably just me not knowing some reason why that won't work.
This is what I want to get, first. Once I have that, I think I can figure the rest out: http://msdn.microsoft.com/en-us/library/ms614834(v=vs.90).aspx
I guess the trick is all in how you phrase your question when searching for the answer.
Out of desperation, I searched for the error message I was receiving, and this (http://forums.adobe.com/message/4227246) provided me the answer, right from here within the CF Forums, something I had already searched.
I was using:
<cfobject type="dotnet" name="Mtable" class="ApplicationDomain"
and getting an error stating that the class was not found in the assembly list (Class ApplicationDomain not found in the specified assembly list. The assembly that contains the class must be provided to the assembly attribute).
By simply giving it the COMPLETE class name, as such:
<cfobject type="dotnet" name="Mtable" class="Microsoft.Web.Administration.ApplicationDomain"
I attained success.
This question is resolved. Hope this helps someone else looking for this solution.
A solution that will certainly help someone else in future - thanks for sharing it!
1 person found this helpful
Alas, the "correct" answer was not the end of this story, not the solution I needed ("how to add a web site dynamically using ColdFusion").
While I was able to consume the object, I could not get their methods to work for me in ColdFusion 8. I am not well trained on using C# and objects and all that (old school programmer; emphasis on the "old" - started programming in 1980 and CF since 1996) and I had to get this working, so I returned to what I knew, and that was command line executables.
For example, to simply add a web site, try this (and, yes, I know that the arguments can be an array, but cfexecute does not like "add site" as an argument, yes you can make it all in the string instead of the array, and yes, the double-quotes are significant); make sure you change the names and bindings to suit your situation, such as having internal IP addresses instead of external:
TestArguments = ArrayNew(1);
TestArguments = '/name:"My Test Site"';
TestArguments = '/physicalPath:"d:\websites\testSite\www"';
TestArguments = '/bindings:"http/127.0.0.1:80:abbtestsite.com,http/127.0.0.1:80:www.abbtestsite.com"';
TestArguments = '/state:Started';
<CFEXECUTE name="C:\Windows\System32\inetsrv\appcmd.exe" variable="resultVariable" timeout="15"
arguments='add site #TestArguments# #TestArguments# #TestArguments# #TestArguments#' />
<cfdump var="#resultVariable#" label="resultVariable" >
<cfdump var="#cfcatch#" label="#cfcatch#">
NOTE: CFEXECUTE does not like using %systemroot% in place of "C:\Windows" (or whereever it is for you).
NOTE: This does not do the DNS entries for you.
This whole post was extremely helpful RLS, thanks!!
Thanks, Mr. McGuigan.
Looking at that code example - I'm betting cfdump will balk at label="#cfcatch#" !! Better to not use a structure in a label!
Guess it never errored for me or I'd have found that out....