Hey, a very simple query...does anyone know what objects/library to use to manipulate IIS server from my code.
I want to get the web site down for some db maintenance and when the job finishes have to bring the site back up again.
Anxious,
eeeks
Printable View
Hey, a very simple query...does anyone know what objects/library to use to manipulate IIS server from my code.
I want to get the web site down for some db maintenance and when the job finishes have to bring the site back up again.
Anxious,
eeeks
Below code is for how to stop web site and start web site.
Contact me if you need to know how to "unload application" or "shut down package for NT" or "shut down COM+ application for W2K". Or you can find these infomatin in MSDN, under ADSI topic.
Zoe
Set oIIsObj = GetMetabaseWebSiteObject("localhost", "mywebsit")
' stop it
oIIsObj.Stop
' start it
oIIsObj.Start
'****************************************
'serverName can be your machine name or "localhost"
'webSiteName is your website name
Function GetMetabaseWebSiteObject(serverName as String, webSiteName as String) as Object
dim objMetabases, objMetabase
Set objMetabases=GetObject("IIS://" & serverName "/W3SVC")
For Each objMetabase In objMetabases
If objMetabase.KeyType = "IIsWebServer" Then
If objMetabase.servercomment = webSiteName Then
Set GetMetabaseWebSiteObject= GetObject(objMetabase.ADsPath)
Set objMetabases= Nothing
Exit function
End If
End If
Next
hey that was quick! thanx for the reply.
eeeks
http://msdn.microsoft.com/library/de...p/abgu26y6.asp
should have more info than you want to know.