Home All Groups Group Topic Archive Search About

Modifing IIS metabase with scripting



Author
13 Mar 2007 9:59 PM
HermanW
I am new to scripting but i need to find out how to write a vbscript to
uncheck "Anonymous access" and check "Intergrated Windows authentication" in
IIS. I cant't seem to find a list of all Metabase objects(objIIS.*).  I also
need to know how to set the 'Group or user names': "users"  permission for a
file  to 'Modify'.

Hope someone can help.
Thanks
--
HWDotNetDeveloper

Author
30 Mar 2007 6:38 PM
JayhawkTuba
Here is something that might help. this is a script that I use and is still
under development. To uncheck anonymous, just set the authbasic = False

To find the metabase names for all IIS Properties, download the IIS Resource
Kit and then connect to a server using the Metabase Explorer. All of the
names are right there. There are a few log properties that for some reason
don't set properly via this script that I pasted in and you have to use the
adsutil.vbs to set those, but other than that, it is very simple.

'ON ERROR RESUME NEXT

'Set MasterW3svc Properties

Servername = "localhost"
strDefaultDoc = "Default.htm,Default.asp,Index.htm,Default.aspx,iisstart.htm"
Set objMasterW3svc = GetObject("IIS://" & Servername & "/w3svc")
objMasterW3svc.EnableDefaultDoc = True
objMasterW3svc.DefaultDoc = strDefaultDoc
objMasterW3svc.AuthBasic = False
objMasterW3svc.DefaultLogonDomain = "\"
objMasterW3svc.LogType = 1
objMasterW3svc.LogFilePeriod = 1
objMasterW3svc.LogFileLocalTimeRollover = 1
objMasterW3svc.LogExtFileUriQuery = True
objMasterW3svc.LogExtFileReferer = True
objMasterW3svc.LogFileDirectory = "E:\logs"
objMasterW3svc.SetInfo


'Set W3svc Default Virtual Server Properties

Set objW3svcVirtSrv = GetObject("IIS://" & Servername & "/w3svc/1")
objW3svcVirtSrv.EnableDefaultDoc = True
objW3svcVirtSrv.DefaultDoc = strDefaultDoc
objW3svcVirtSrv.AuthBasic = False
objW3svcVirtSrv.DefaultLogonDomain = "\"
objW3svcVirtSrv.LogType = 1
objW3svcVirtSrv.LogFilePeriod = 1
objW3svcVirtSrv.LogFileLocalTimeRollover = 1
objW3svcVirtSrv.LogExtFileUriQuery = True
objW3svcVirtSrv.LogExtFileReferer = True
objW3svcVirtSrv.LogFileDirectory = "E:\logs"
objW3svcVirtSrv.SetInfo


'Set SMTP Properties

'Set objSMTPSvc = GetObject("IIS://" & Servername & "/SMTPsvc")
'objSMTPSvc.LogType = 1
'objSMTPSvc.LogFileDirectory = "E:\logs"
'objSMTPSvc.LogFilePeriod = 1
'objSMTPSvc.LogExtFileDate = True
'objSMTPSvc.LogExtFileTime = True   
'objSMTPSvc.LogExtFileBytesSent = True
'objSMTPSvc.LogExtFileClientIP = True
'objSMTPSvc.LogExtFileComputerName = True
'objSMTPSvc.LogExtFileCookie = True
'objSMTPSvc.LogExtFileFlags = True
'objSMTPSvc.LogExtFileHttpStatus = True
'objSMTPSvc.LogExtFileMethod = True
'objSMTPSvc.LogExtFileProtocolVersion = True
'objSMTPSvc.LogExtFileReferer = True
'objSMTPSvc.LogExtFileServerIP = True
'objSMTPSvc.LogExtFileServerPort = True
'objSMTPSvc.LogExtFileSiteName = True
'objSMTPSvc.LogExtFileTimeTaken = True
'objSMTPSvc.LogExtFileUriQuery = True
'objSMTPSvc.LogExtFileUriStem = True
'objSMTPSvc.LogExtFileUserAgent = True
'objSMTPSvc.LogExtFileUserName = True
'objSMTPSvc.LogExtFileWin32Status = True
'objSMTPSvc.SendNdrTo = "IISRet***@somedomain.com"
'objSMTPSvc.SendBadTo = "IISRet***@somedomain.com"
'objSMTPSvc.RelayForAuth = 0
'objSMTPSvc.SmartHost="smtp.somedomain.com"
'objSMTPSvc.SmartHostType="2"
'objSMTPSvc.SetInfo

'Set SMTP Virtual Server Properties

'Set objSMTPVirtSrv = GetObject("IIS://" & Servername & "/SMTPsvc/1")
'objSMTPVirtSrv.LogType = 1
'objSMTPVirtSrv.LogFileDirectory = "E:\logs"
'objSMTPVirtSrv.LogFilePeriod = 1
'objSMTPVirtSrv.LogExtFileDate = True
'objSMTPVirtSrv.LogExtFileTime = True
'objSMTPVirtSrv.LogExtFileBytesSent = True
'objSMTPVirtSrv.LogExtFileClientIP = True
'objSMTPVirtSrv.LogExtFileComputerName = True
'objSMTPVirtSrv.LogExtFileCookie = True
'objSMTPVirtSrv.LogExtFileFlags = True
'objSMTPVirtSrv.LogExtFileHttpStatus = True
'objSMTPVirtSrv.LogExtFileMethod = True
'objSMTPVirtSrv.LogExtFileProtocolVersion = True
'objSMTPVirtSrv.LogExtFileReferer = True
'objSMTPVirtSrv.LogExtFileServerIP = True
'objSMTPVirtSrv.LogExtFileServerPort = True
'objSMTPVirtSrv.LogExtFileSiteName = True
'objSMTPVirtSrv.LogExtFileTimeTaken = True
'objSMTPVirtSrv.LogExtFileUriQuery = True
'objSMTPVirtSrv.LogExtFileUriStem = True
'objSMTPVirtSrv.LogExtFileUserAgent = True
'objSMTPVirtSrv.LogExtFileUserName = True
'objSMTPVirtSrv.LogExtFileWin32Status = True
'objSMTPVirtSrv.SendNdrTo = "IISRet***@somedomain.com"
'objSMTPVirtSrv.SendBadTo = "IISRet***@somedomain.com"
'objSMTPVirtSrv.RelayForAuth = 0
'objSMTPVirtSrv.SmartHost="smtp.somedomain.com"
'objSMTPVirtSrv.SmartHostType="2"
'objSMTPVirtSrv.SetInfo

'Execute one offs which consist of setting the path for IIS Default web and
establish the application mappings.
Set WSHShell = CreateObject("WScript.Shell")
Set oExec = WshShell.exec("IISOneOffs.bat")
Set WSHShell = Nothing


Set objMasterW3svc = Nothing
Set objW3svcVirtSrv = Nothing
'Set 'objSMTPSrv = Nothing
'Set 'objSMTPVirtSrv = Nothing

Show quote
"HermanW" wrote:

> I am new to scripting but i need to find out how to write a vbscript to
> uncheck "Anonymous access" and check "Intergrated Windows authentication" in
> IIS. I cant't seem to find a list of all Metabase objects(objIIS.*).  I also
> need to know how to set the 'Group or user names': "users"  permission for a
> file  to 'Modify'.
>
> Hope someone can help.
> Thanks
> --
> HWDotNetDeveloper

AddThis Social Bookmark Button