|
-
Oct 30th, 2001, 10:54 AM
#1
Thread Starter
Junior Member
how do i control IIS server from my VB code?
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
-
Oct 30th, 2001, 11:21 AM
#2
New Member
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
-
Oct 30th, 2001, 11:55 AM
#3
Thread Starter
Junior Member
Thanx!
hey that was quick! thanx for the reply.
eeeks
-
Oct 30th, 2001, 12:00 PM
#4
Black Cat
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|