发新话题
打印

[转载]IIS Web Server Settings

[转载]IIS Web Server Settings

文章作者:Jesper Hanno Hansen

' ***************************************************************
' Created by Jesper Hanno Hansen, Jesper@Wbem.dk, www.Wbem.dk
' Use: Cscript IIsWebServerSetting.vbs
' ***************************************************************

Dim sServer
sServer = "."

DoIIsWebServerSetting

Sub DoIIsWebServerSetting
   On Error Resume Next

   Dim SWbemLocator
   Set SWbemLocator = CreateObject("WbemScripting.SWbemLocator")

   Dim SWbemServices
   Set SWbemServices = SWbemLocator.ConnectServer(sServer,"root\MicrosoftIISv2")

   Dim objWbemObjectSet
   Set objWbemObjectSet = SWbemServices.ExecQuery("Select * From IIsWebServerSetting", "WQL")

   Dim sProperty

   For Each sProperty in objWbemObjectSet
      DoWrite "AccessExecute", DoCheckIfEmpty(sProperty.AccessExecute)
      DoWrite "AccessFlags", DoCheckIfEmpty(sProperty.AccessFlags)
      DoWrite "AccessNoPhysicalDir", DoCheckIfEmpty(sProperty.AccessNoPhysicalDir)
      DoWrite "AccessNoRemoteExecute", DoCheckIfEmpty(sProperty.AccessNoRemoteExecute)
      DoWrite "AccessNoRemoteRead", DoCheckIfEmpty(sProperty.AccessNoRemoteRead)
      DoWrite "AccessNoRemoteScript", DoCheckIfEmpty(sProperty.AccessNoRemoteScript)
      DoWrite "AccessNoRemoteWrite", DoCheckIfEmpty(sProperty.AccessNoRemoteWrite)
      DoWrite "AccessRead", DoCheckIfEmpty(sProperty.AccessRead)
      DoWrite "AccessScript", DoCheckIfEmpty(sProperty.AccessScript)
      DoWrite "AccessSource", DoCheckIfEmpty(sProperty.AccessSource)
      DoWrite "AccessSSL", DoCheckIfEmpty(sProperty.AccessSSL)
      DoWrite "AccessSSL128", DoCheckIfEmpty(sProperty.AccessSSL128)
      DoWrite "AccessSSLFlags", DoCheckIfEmpty(sProperty.AccessSSLFlags)
      DoWrite "AccessSSLMapCert", DoCheckIfEmpty(sProperty.AccessSSLMapCert)
      DoWrite "AccessSSLNegotiateCert", DoCheckIfEmpty(sProperty.AccessSSLNegotiateCert)
      DoWrite "AccessSSLRequireCert", DoCheckIfEmpty(sProperty.AccessSSLRequireCert)
      DoWrite "AccessWrite", DoCheckIfEmpty(sProperty.AccessWrite)
        For aWMI = LBound(sProperty.AdminACLBin) To UBound(sProperty.AdminACLBin)
           DoWrite "AdminACLBin", DoCheckIfEmpty(sProperty.AdminACLBin(aWMI))
        Next
      DoWrite "AllowKeepAlive", DoCheckIfEmpty(sProperty.AllowKeepAlive)
      DoWrite "AllowPathInfoForScriptMappings", DoCheckIfEmpty(sProperty.AllowPathInfoForScriptMappings)
      DoWrite "AnonymousPasswordSync", DoCheckIfEmpty(sProperty.AnonymousPasswordSync)
      DoWrite "AnonymousUserName", DoCheckIfEmpty(sProperty.AnonymousUserName)
      DoWrite "AnonymousUserPass", DoCheckIfEmpty(sProperty.AnonymousUserPass)
      DoWrite "AppAllowClientDebug", DoCheckIfEmpty(sProperty.AppAllowClientDebug)
      DoWrite "AppAllowDebugging", DoCheckIfEmpty(sProperty.AppAllowDebugging)
      DoWrite "AppFriendlyName", DoCheckIfEmpty(sProperty.AppFriendlyName)
      DoWrite "AppOopRecoverLimit", DoCheckIfEmpty(sProperty.AppOopRecoverLimit)
      DoWrite "AppPoolId", DoCheckIfEmpty(sProperty.AppPoolId)
      DoWrite "AppWamClsid", DoCheckIfEmpty(sProperty.AppWamClsid)
      DoWrite "AspAllowOutOfProcComponents", DoCheckIfEmpty(sProperty.AspAllowOutOfProcComponents)
      DoWrite "AspAllowSessionState", DoCheckIfEmpty(sProperty.AspAllowSessionState)
      DoWrite "AspAppServiceFlags", DoCheckIfEmpty(sProperty.AspAppServiceFlags)
      DoWrite "AspBufferingLimit", DoCheckIfEmpty(sProperty.AspBufferingLimit)
      DoWrite "AspBufferingOn", DoCheckIfEmpty(sProperty.AspBufferingOn)
      DoWrite "AspCalcLineNumber", DoCheckIfEmpty(sProperty.AspCalcLineNumber)
      DoWrite "AspCodepage", DoCheckIfEmpty(sProperty.AspCodepage)
      DoWrite "AspDiskTemplateCacheDirectory", DoCheckIfEmpty(sProperty.AspDiskTemplateCacheDirectory)
      DoWrite "AspEnableApplicationRestart", DoCheckIfEmpty(sProperty.AspEnableApplicationRestart)
      DoWrite "AspEnableAspHtmlFallback", DoCheckIfEmpty(sProperty.AspEnableAspHtmlFallback)
      DoWrite "AspEnableChunkedEncoding", DoCheckIfEmpty(sProperty.AspEnableChunkedEncoding)
      DoWrite "AspEnableParentPaths", DoCheckIfEmpty(sProperty.AspEnableParentPaths)
      DoWrite "AspEnableSxs", DoCheckIfEmpty(sProperty.AspEnableSxs)
      DoWrite "AspEnableTracker", DoCheckIfEmpty(sProperty.AspEnableTracker)
      DoWrite "AspEnableTypelibCache", DoCheckIfEmpty(sProperty.AspEnableTypelibCache)
      DoWrite "AspErrorsToNTLog", DoCheckIfEmpty(sProperty.AspErrorsToNTLog)
      DoWrite "AspExceptionCatchEnable", DoCheckIfEmpty(sProperty.AspExceptionCatchEnable)
      DoWrite "AspExecuteInMTA", DoCheckIfEmpty(sProperty.AspExecuteInMTA)
      DoWrite "AspKeepSessionIDSecure", DoCheckIfEmpty(sProperty.AspKeepSessionIDSecure)
      DoWrite "AspLCID", DoCheckIfEmpty(sProperty.AspLCID)
      DoWrite "AspLogErrorRequests", DoCheckIfEmpty(sProperty.AspLogErrorRequests)
      DoWrite "AspMaxDiskTemplateCacheFiles", DoCheckIfEmpty(sProperty.AspMaxDiskTemplateCacheFiles)
      DoWrite "AspMaxRequestEntityAllowed", DoCheckIfEmpty(sProperty.AspMaxRequestEntityAllowed)
      DoWrite "AspPartitionID", DoCheckIfEmpty(sProperty.AspPartitionID)
      DoWrite "AspProcessorThreadMax", DoCheckIfEmpty(sProperty.AspProcessorThreadMax)
      DoWrite "AspQueueConnectionTestTime", DoCheckIfEmpty(sProperty.AspQueueConnectionTestTime)
      DoWrite "AspQueueTimeout", DoCheckIfEmpty(sProperty.AspQueueTimeout)
      DoWrite "AspRequestQueueMax", DoCheckIfEmpty(sProperty.AspRequestQueueMax)
      DoWrite "AspRunOnEndAnonymously", DoCheckIfEmpty(sProperty.AspRunOnEndAnonymously)
      DoWrite "AspScriptEngineCacheMax", DoCheckIfEmpty(sProperty.AspScriptEngineCacheMax)
      DoWrite "AspScriptErrorMessage", DoCheckIfEmpty(sProperty.AspScriptErrorMessage)
      DoWrite "AspScriptErrorSentToBrowser", DoCheckIfEmpty(sProperty.AspScriptErrorSentToBrowser)
      DoWrite "AspScriptFileCacheSize", DoCheckIfEmpty(sProperty.AspScriptFileCacheSize)
      DoWrite "AspScriptLanguage", DoCheckIfEmpty(sProperty.AspScriptLanguage)
      DoWrite "AspScriptTimeout", DoCheckIfEmpty(sProperty.AspScriptTimeout)
      DoWrite "AspSessionMax", DoCheckIfEmpty(sProperty.AspSessionMax)
      DoWrite "AspSessionTimeout", DoCheckIfEmpty(sProperty.AspSessionTimeout)
      DoWrite "AspSxsName", DoCheckIfEmpty(sProperty.AspSxsName)
      DoWrite "AspTrackThreadingModel", DoCheckIfEmpty(sProperty.AspTrackThreadingModel)
      DoWrite "AspUsePartition", DoCheckIfEmpty(sProperty.AspUsePartition)
      DoWrite "AuthAdvNotifyDisable", DoCheckIfEmpty(sProperty.AuthAdvNotifyDisable)
      DoWrite "AuthAnonymous", DoCheckIfEmpty(sProperty.AuthAnonymous)
      DoWrite "AuthBasic", DoCheckIfEmpty(sProperty.AuthBasic)
      DoWrite "AuthChangeDisable", DoCheckIfEmpty(sProperty.AuthChangeDisable)
      DoWrite "AuthChangeUnsecure", DoCheckIfEmpty(sProperty.AuthChangeUnsecure)
      DoWrite "AuthFlags", DoCheckIfEmpty(sProperty.AuthFlags)
      DoWrite "AuthMD5", DoCheckIfEmpty(sProperty.AuthMD5)
      DoWrite "AuthNTLM", DoCheckIfEmpty(sProperty.AuthNTLM)
      DoWrite "AuthPassport", DoCheckIfEmpty(sProperty.AuthPassport)
      DoWrite "AuthPersistence", DoCheckIfEmpty(sProperty.AuthPersistence)
      DoWrite "AuthPersistSingleRequest", DoCheckIfEmpty(sProperty.AuthPersistSingleRequest)
      DoWrite "AzEnable", DoCheckIfEmpty(sProperty.AzEnable)
      DoWrite "AzImpersonationLevel", DoCheckIfEmpty(sProperty.AzImpersonationLevel)
      DoWrite "AzScopeName", DoCheckIfEmpty(sProperty.AzScopeName)
      DoWrite "AzStoreName", DoCheckIfEmpty(sProperty.AzStoreName)
      DoWrite "CacheControlCustom", DoCheckIfEmpty(sProperty.CacheControlCustom)
      DoWrite "CacheControlMaxAge", DoCheckIfEmpty(sProperty.CacheControlMaxAge)
      DoWrite "CacheControlNoCache", DoCheckIfEmpty(sProperty.CacheControlNoCache)
      DoWrite "CacheISAPI", DoCheckIfEmpty(sProperty.CacheISAPI)
      DoWrite "Caption", DoCheckIfEmpty(sProperty.Caption)
      DoWrite "CertCheckMode", DoCheckIfEmpty(sProperty.CertCheckMode)
      DoWrite "CGITimeout", DoCheckIfEmpty(sProperty.CGITimeout)
      DoWrite "ClusterEnabled", DoCheckIfEmpty(sProperty.ClusterEnabled)
      DoWrite "ConnectionTimeout", DoCheckIfEmpty(sProperty.ConnectionTimeout)
      DoWrite "ContentIndexed", DoCheckIfEmpty(sProperty.ContentIndexed)
      DoWrite "CreateCGIWithNewConsole", DoCheckIfEmpty(sProperty.CreateCGIWithNewConsole)
      DoWrite "CreateProcessAsUser", DoCheckIfEmpty(sProperty.CreateProcessAsUser)
      DoWrite "DefaultDoc", DoCheckIfEmpty(sProperty.DefaultDoc)
      DoWrite "DefaultDocFooter", DoCheckIfEmpty(sProperty.DefaultDocFooter)
      DoWrite "DefaultLogonDomain", DoCheckIfEmpty(sProperty.DefaultLogonDomain)
      DoWrite "Description", DoCheckIfEmpty(sProperty.Description)
      DoWrite "DirBrowseFlags", DoCheckIfEmpty(sProperty.DirBrowseFlags)
      DoWrite "DirBrowseShowDate", DoCheckIfEmpty(sProperty.DirBrowseShowDate)
      DoWrite "DirBrowseShowExtension", DoCheckIfEmpty(sProperty.DirBrowseShowExtension)
      DoWrite "DirBrowseShowLongDate", DoCheckIfEmpty(sProperty.DirBrowseShowLongDate)
      DoWrite "DirBrowseShowSize", DoCheckIfEmpty(sProperty.DirBrowseShowSize)
      DoWrite "DirBrowseShowTime", DoCheckIfEmpty(sProperty.DirBrowseShowTime)
      DoWrite "DisableSocketPooling", DoCheckIfEmpty(sProperty.DisableSocketPooling)
      DoWrite "DisableStaticFileCache", DoCheckIfEmpty(sProperty.DisableStaticFileCache)
      DoWrite "DoDynamicCompression", DoCheckIfEmpty(sProperty.DoDynamicCompression)
      DoWrite "DontLog", DoCheckIfEmpty(sProperty.DontLog)
      DoWrite "DoStaticCompression", DoCheckIfEmpty(sProperty.DoStaticCompression)
      DoWrite "EnableDefaultDoc", DoCheckIfEmpty(sProperty.EnableDefaultDoc)
      DoWrite "EnableDirBrowsing", DoCheckIfEmpty(sProperty.EnableDirBrowsing)
      DoWrite "EnableDocFooter", DoCheckIfEmpty(sProperty.EnableDocFooter)
      DoWrite "EnableReverseDns", DoCheckIfEmpty(sProperty.EnableReverseDns)
      DoWrite "FrontPageWeb", DoCheckIfEmpty(sProperty.FrontPageWeb)
        For aWMI = LBound(sProperty.HttpCustomHeaders) To UBound(sProperty.HttpCustomHeaders)
           DoWrite "HttpCustomHeaders", DoCheckIfEmpty(sProperty.HttpCustomHeaders(aWMI))
        Next
        For aWMI = LBound(sProperty.HttpErrors) To UBound(sProperty.HttpErrors)
           DoWrite "HttpErrors", DoCheckIfEmpty(sProperty.HttpErrors(aWMI))
        Next
      DoWrite "HttpExpires", DoCheckIfEmpty(sProperty.HttpExpires)
        For aWMI = LBound(sProperty.HttpPics) To UBound(sProperty.HttpPics)
           DoWrite "HttpPics", DoCheckIfEmpty(sProperty.HttpPics(aWMI))
        Next
      DoWrite "LogExtFileBytesRecv", DoCheckIfEmpty(sProperty.LogExtFileBytesRecv)
      DoWrite "LogExtFileBytesSent", DoCheckIfEmpty(sProperty.LogExtFileBytesSent)
      DoWrite "LogExtFileClientIp", DoCheckIfEmpty(sProperty.LogExtFileClientIp)
      DoWrite "LogExtFileComputerName", DoCheckIfEmpty(sProperty.LogExtFileComputerName)
      DoWrite "LogExtFileCookie", DoCheckIfEmpty(sProperty.LogExtFileCookie)
      DoWrite "LogExtFileDate", DoCheckIfEmpty(sProperty.LogExtFileDate)
      DoWrite "LogExtFileFlags", DoCheckIfEmpty(sProperty.LogExtFileFlags)
      DoWrite "LogExtFileHost", DoCheckIfEmpty(sProperty.LogExtFileHost)
      DoWrite "LogExtFileHttpStatus", DoCheckIfEmpty(sProperty.LogExtFileHttpStatus)
      DoWrite "LogExtFileHttpSubStatus", DoCheckIfEmpty(sProperty.LogExtFileHttpSubStatus)
      DoWrite "LogExtFileMethod", DoCheckIfEmpty(sProperty.LogExtFileMethod)
      DoWrite "LogExtFileProtocolVersion", DoCheckIfEmpty(sProperty.LogExtFileProtocolVersion)
      DoWrite "LogExtFileReferer", DoCheckIfEmpty(sProperty.LogExtFileReferer)
      DoWrite "LogExtFileServerIp", DoCheckIfEmpty(sProperty.LogExtFileServerIp)
      DoWrite "LogExtFileServerPort", DoCheckIfEmpty(sProperty.LogExtFileServerPort)
      DoWrite "LogExtFileSiteName", DoCheckIfEmpty(sProperty.LogExtFileSiteName)
      DoWrite "LogExtFileTime", DoCheckIfEmpty(sProperty.LogExtFileTime)
      DoWrite "LogExtFileTimeTaken", DoCheckIfEmpty(sProperty.LogExtFileTimeTaken)
      DoWrite "LogExtFileUriQuery", DoCheckIfEmpty(sProperty.LogExtFileUriQuery)
      DoWrite "LogExtFileUriStem", DoCheckIfEmpty(sProperty.LogExtFileUriStem)
      DoWrite "LogExtFileUserAgent", DoCheckIfEmpty(sProperty.LogExtFileUserAgent)
      DoWrite "LogExtFileUserName", DoCheckIfEmpty(sProperty.LogExtFileUserName)
      DoWrite "LogExtFileWin32Status", DoCheckIfEmpty(sProperty.LogExtFileWin32Status)
      DoWrite "LogFileDirectory", DoCheckIfEmpty(sProperty.LogFileDirectory)
      DoWrite "LogFileLocaltimeRollover", DoCheckIfEmpty(sProperty.LogFileLocaltimeRollover)
      DoWrite "LogFilePeriod", DoCheckIfEmpty(sProperty.LogFilePeriod)
      DoWrite "LogFileTruncateSize", DoCheckIfEmpty(sProperty.LogFileTruncateSize)
      DoWrite "LogOdbcDataSource", DoCheckIfEmpty(sProperty.LogOdbcDataSource)
      DoWrite "LogOdbcPassword", DoCheckIfEmpty(sProperty.LogOdbcPassword)
      DoWrite "LogOdbcTableName", DoCheckIfEmpty(sProperty.LogOdbcTableName)
      DoWrite "LogOdbcUserName", DoCheckIfEmpty(sProperty.LogOdbcUserName)
      DoWrite "LogonMethod", DoCheckIfEmpty(sProperty.LogonMethod)
      DoWrite "LogPluginClsid", DoCheckIfEmpty(sProperty.LogPluginClsid)
      DoWrite "LogType", DoCheckIfEmpty(sProperty.LogType)
      DoWrite "MaxBandwidth", DoCheckIfEmpty(sProperty.MaxBandwidth)
      DoWrite "MaxBandwidthBlocked", DoCheckIfEmpty(sProperty.MaxBandwidthBlocked)
      DoWrite "MaxConnections", DoCheckIfEmpty(sProperty.MaxConnections)
      DoWrite "MaxEndpointConnections", DoCheckIfEmpty(sProperty.MaxEndpointConnections)
      DoWrite "MaxRequestEntityAllowed", DoCheckIfEmpty(sProperty.MaxRequestEntityAllowed)
        For aWMI = LBound(sProperty.MimeMap) To UBound(sProperty.MimeMap)
           DoWrite "MimeMap", DoCheckIfEmpty(sProperty.MimeMap(aWMI))
        Next
      DoWrite "Name", DoCheckIfEmpty(sProperty.Name)
      DoWrite "NTAuthenticationProviders", DoCheckIfEmpty(sProperty.NTAuthenticationProviders)
      DoWrite "PassportRequireADMapping", DoCheckIfEmpty(sProperty.PassportRequireADMapping)
      DoWrite "PasswordCacheTTL", DoCheckIfEmpty(sProperty.PasswordCacheTTL)
      DoWrite "PasswordChangeFlags", DoCheckIfEmpty(sProperty.PasswordChangeFlags)
      DoWrite "PasswordExpirePrenotifyDays", DoCheckIfEmpty(sProperty.PasswordExpirePrenotifyDays)
      DoWrite "PoolIdcTimeout", DoCheckIfEmpty(sProperty.PoolIdcTimeout)
      DoWrite "ProcessNTCRIfLoggedOn", DoCheckIfEmpty(sProperty.ProcessNTCRIfLoggedOn)
      DoWrite "Realm", DoCheckIfEmpty(sProperty.Realm)
        For aWMI = LBound(sProperty.RedirectHeaders) To UBound(sProperty.RedirectHeaders)
           DoWrite "RedirectHeaders", DoCheckIfEmpty(sProperty.RedirectHeaders(aWMI))
        Next
      DoWrite "RevocationFreshnessTime", DoCheckIfEmpty(sProperty.RevocationFreshnessTime)
      DoWrite "RevocationURLRetrievalTimeout", DoCheckIfEmpty(sProperty.RevocationURLRetrievalTimeout)
        For aWMI = LBound(sProperty.ScriptMaps) To UBound(sProperty.ScriptMaps)
           DoWrite "ScriptMaps", DoCheckIfEmpty(sProperty.ScriptMaps(aWMI))
        Next
        For aWMI = LBound(sProperty.SecureBindings) To UBound(sProperty.SecureBindings)
           DoWrite "SecureBindings", DoCheckIfEmpty(sProperty.SecureBindings(aWMI))
        Next
      DoWrite "ServerAutoStart", DoCheckIfEmpty(sProperty.ServerAutoStart)
        For aWMI = LBound(sProperty.ServerBindings) To UBound(sProperty.ServerBindings)
           DoWrite "ServerBindings", DoCheckIfEmpty(sProperty.ServerBindings(aWMI))
        Next
      DoWrite "ServerCommand", DoCheckIfEmpty(sProperty.ServerCommand)
      DoWrite "ServerComment", DoCheckIfEmpty(sProperty.ServerComment)
      DoWrite "ServerListenBacklog", DoCheckIfEmpty(sProperty.ServerListenBacklog)
      DoWrite "ServerListenTimeout", DoCheckIfEmpty(sProperty.ServerListenTimeout)
      DoWrite "ServerSize", DoCheckIfEmpty(sProperty.ServerSize)
      DoWrite "SettingID", DoCheckIfEmpty(sProperty.SettingID)
      DoWrite "ShutdownTimeLimit", DoCheckIfEmpty(sProperty.ShutdownTimeLimit)
      DoWrite "SSIExecDisable", DoCheckIfEmpty(sProperty.SSIExecDisable)
      DoWrite "SSLAlwaysNegoClientCert", DoCheckIfEmpty(sProperty.SSLAlwaysNegoClientCert)
      DoWrite "SslCtlIdentifier", DoCheckIfEmpty(sProperty.SslCtlIdentifier)
      DoWrite "SslCtlStoreName", DoCheckIfEmpty(sProperty.SslCtlStoreName)
      DoWrite "SSLStoreName", DoCheckIfEmpty(sProperty.SSLStoreName)
      DoWrite "UploadReadAheadSize", DoCheckIfEmpty(sProperty.UploadReadAheadSize)
      DoWrite "UseDigestSSP", DoCheckIfEmpty(sProperty.UseDigestSSP)
      DoWrite "Win32Error", DoCheckIfEmpty(sProperty.Win32Error)
      Wscript.Echo
   Next
End Sub

Function DoCheckIfEmpty(sValue)
   If IsNull(sValue) Then
      DoCheckIfEmpty = "Empty"
   Else
      DoCheckIfEmpty = sValue
   End If
End Function

Sub DoWrite(sText, sValue)
   WScript.Echo sText & DoFormat(sText), sValue
End Sub

Function DoFormat(sText)
   DoFormat = Space(31 - Len(sText)) & " = "
End Function
曾几何时,有人对我说:装B遭雷劈。我说:去你妈的。于是,这个人又对我说:如果再说脏话,上帝会惩罚你的。我说:我操上帝。结论:彪悍的人生不需要上帝。

TOP

发新话题