IIS 5 on W2k server.

I would like to modify/remove/set IIS properties programmatically.

I found this code on MSDN:

==========================================
Dim CurrServer
Set CurrServer = GetObject("IIS:/LocalHost/W3svc/1")
CurrServer.LogExtFileBytesSent = True
CurrServer.SetInfo
==========================================

However when I try to run this code in a VBS file (I log on machine as
Administrator) I obtain
this error:



==========================================
Windows Script Host
Script: C:\Log.vbs
Line: 2
Carachter: 1
Error: 0x80005000
Code: 80005000
Origin: (null)
==========================================


I can run this type of script instead:

==========================================
Set obj3 = GetObject("IIS://LOCALHOST/W3SVC/1/Root")
Obj3.AccessFlags = 513
obj3.SetInfo
==========================================


How can I obtain the first script to run?

Any help much appreciated

Regards.

--
Fabrizio Maccarrone
--
YAMSSQLU
(Yet Another MSSQL User)

Re: Modify IIS log properties via script by David

David
Tue Jan 13 23:24:04 CST 2004

The reason the first script doesn't work is because there is a '/' missing
after IIS:

Set CurrServer = GetObject("IIS://LocalHost/W3svc/1")

--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Fabrizio Maccarrone" <fabrizio (at) 7mates (punto) com> wrote in message
news:O%23wuGPb2DHA.3436@tk2msftngp13.phx.gbl...
IIS 5 on W2k server.

I would like to modify/remove/set IIS properties programmatically.

I found this code on MSDN:

==========================================
Dim CurrServer
Set CurrServer = GetObject("IIS:/LocalHost/W3svc/1")
CurrServer.LogExtFileBytesSent = True
CurrServer.SetInfo
==========================================

However when I try to run this code in a VBS file (I log on machine as
Administrator) I obtain
this error:



==========================================
Windows Script Host
Script: C:\Log.vbs
Line: 2
Carachter: 1
Error: 0x80005000
Code: 80005000
Origin: (null)
==========================================


I can run this type of script instead:

==========================================
Set obj3 = GetObject("IIS://LOCALHOST/W3SVC/1/Root")
Obj3.AccessFlags = 513
obj3.SetInfo
==========================================


How can I obtain the first script to run?

Any help much appreciated

Regards.

--
Fabrizio Maccarrone
--
YAMSSQLU
(Yet Another MSSQL User)