Saturday, December 5, 2009

IIS Web Server Properties

When I was trying to automate the creation of some websites and web applications, I was having a lot of trouble finding the attributes associated with a Web Application so I decided to write a script to output and ist them here.

If you are interested in the code, I wrote it in PowerShell.  Here it is:
function List-WebServerProps() {
    $server = New-Object System.DirectoryServices.DirectoryEntry("IIS://localhost/W3SVC/1")
    $serverSchema = New-Object System.DirectoryServices.DirectoryEntry($server.Schema)
    foreach ($propName in $serverSchema.OptionalProperties) {
        $prop = $server.Properties[$propName]
        $value = $prop.Value
        $type = ""
        if ($value) {
            $type = $value.GetType().ToString()
        }
        $out = new-object psobject
        $out | add-member noteproperty Name $prop.PropertyName
        $out | add-member noteproperty Type $type
        write-output $out
    }
}

Common Properties

Name Type
AccessFlags int
AccessSSLFlags
AnonymousUserName string
AppPoolId string
AuthFlags int
DefaultDoc string
DirBrowseFlags int
HttpCustomHeaders string
HttpErrors object[]
KeyType string
LogFileDirectory string
LogPluginClsid string
NTAuthenticationProviders string
RedirectHeaders
ScriptMaps object[]
ServerBindings string
ServerCommand int
ServerComment string
ServerState int
TraceUriPrefix
Win32Error

Complete List

Name Value
AccessExecute
AccessFlags System.Int32
AccessNoPhysicalDir
AccessNoRemoteExecute
AccessNoRemoteRead
AccessNoRemoteScript
AccessNoRemoteWrite
AccessRead System.Boolean
AccessScript System.Boolean
AccessSource
AccessSSL
AccessSSL128
AccessSSLFlags
AccessSSLMapCert
AccessSSLNegotiateCert
AccessSSLRequireCert
AccessWrite
AdminACLBin
AllowKeepAlive System.Boolean
AllowPathInfoForScriptMappings
AnonymousPasswordSync System.Boolean
AnonymousUserName System.String
AnonymousUserPass
AppAllowClientDebug
AppAllowDebugging
AppFriendlyName
AppIsolated System.Int32
AppOopRecoverLimit System.Int32
AppPackageID
AppPackageName
AppPoolId System.String
AppRoot
AppWamClsid
AspAllowOutOfProcComponents System.Boolean
AspAllowSessionState System.Boolean
AspAppServiceFlags
AspBufferingLimit System.Int32
AspBufferingOn System.Boolean
AspCalcLineNumber System.Boolean
AspCodepage
AspDiskTemplateCacheDirectory System.String
AspEnableApplicationRestart System.Boolean
AspEnableAspHtmlFallback
AspEnableChunkedEncoding System.Boolean
AspEnableParentPaths
AspEnableSxs
AspEnableTracker
AspEnableTypelibCache System.Boolean
AspErrorsToNTLog
AspExceptionCatchEnable System.Boolean
AspExecuteInMTA
AspKeepSessionIDSecure System.Int32
AspLCID
AspLogErrorRequests System.Boolean
AspMaxDiskTemplateCacheFiles System.Int32
AspMaxRequestEntityAllowed System.Int32
AspPartitionID
AspProcessorThreadMax System.Int32
AspQueueConnectionTestTime System.Int32
AspQueueTimeout System.Int32
AspRequestQueueMax System.Int32
AspRunOnEndAnonymously System.Boolean
AspScriptEngineCacheMax System.Int32
AspScriptErrorMessage System.String
AspScriptErrorSentToBrowser System.Boolean
AspScriptFileCacheSize System.Int32
AspScriptLanguage System.String
AspScriptTimeout System.Int32
AspSessionMax System.Int32
AspSessionTimeout System.Int32
AspSxsName
AspTrackThreadingModel
AspUsePartition
AuthAdvNotifyDisable
AuthAnonymous System.Boolean
AuthBasic
AuthChangeDisable
AuthChangeUnsecure
AuthFlags System.Int32
AuthMD5
AuthNTLM
AuthPassport
AuthPersistence System.Int32
AuthPersistSingleRequest System.Boolean
AzEnable
AzImpersonationLevel
AzScopeName
AzStoreName
Bindings
CacheControlCustom
CacheControlMaxAge
CacheControlNoCache
CacheISAPI System.Boolean
CertCheckMode
CGITimeout System.Int32
ClusterEnabled
ConnectionTimeout System.Int32
ContentIndexed
CreateCGIWithNewConsole
CreateProcessAsUser System.Boolean
DefaultDoc System.String
DefaultDocFooter
DefaultLogonDomain
DirBrowseFlags System.Int32
DirBrowseShowDate System.Boolean
DirBrowseShowExtension System.Boolean
DirBrowseShowLongDate
DirBrowseShowSize System.Boolean
DirBrowseShowTime System.Boolean
DisableSocketPooling System.Boolean
DisableStaticFileCache
DoDynamicCompression
DontLog
DoStaticCompression
EnableDefaultDoc System.Boolean
EnableDirBrowsing
EnableDocFooter
EnabledProtocols
EnableReverseDns
FrontPageWeb
HttpCustomHeaders System.String
HttpErrors System.Object[]
HttpErrorsExistingResponse
HttpExpires System.String
HttpPics
IPSecurity System.__ComObject
KeyType System.String
LogExtFileBytesRecv
LogExtFileBytesSent
LogExtFileClientIp System.Boolean
LogExtFileComputerName
LogExtFileCookie
LogExtFileDate
LogExtFileFlags System.Int32
LogExtFileHost
LogExtFileHttpStatus System.Boolean
LogExtFileHttpSubStatus
LogExtFileMethod System.Boolean
LogExtFileProtocolVersion
LogExtFileReferer
LogExtFileServerIp
LogExtFileServerPort
LogExtFileSiteName
LogExtFileTime System.Boolean
LogExtFileTimeTaken
LogExtFileUriQuery
LogExtFileUriStem System.Boolean
LogExtFileUserAgent
LogExtFileUserName
LogExtFileWin32Status
LogFileDirectory System.String
LogFileLocaltimeRollover
LogFilePeriod System.Int32
LogFileTruncateSize System.Int32
LogOdbcDataSource System.String
LogOdbcPassword
LogOdbcTableName System.String
LogOdbcUserName System.String
LogonMethod System.Int32
LogPluginClsid System.String
LogType System.Int32
MaxBandwidth System.Int32
MaxBandwidthBlocked System.Int32
MaxConnections
MaxEndpointConnections System.Int32
MaxRequestEntityAllowed System.Int32
MimeMap
Name Type
NTAuthenticationProviders System.String
PassportRequireADMapping System.Int32
PasswordCacheTTL System.Int32
PasswordChangeFlags
PasswordExpirePrenotifyDays
PoolIdcTimeout
ProcessNTCRIfLoggedOn System.Boolean
Realm
RedirectHeaders
RevocationFreshnessTime System.Int32
RevocationURLRetrievalTimeout
ScriptMaps System.Object[]
SecureBindings
ServerAutoStart System.Boolean
ServerBindings System.String
ServerCommand System.Int32
ServerComment System.String
ServerListenBacklog System.Int32
ServerListenTimeout System.Int32
ServerSize System.Int32
ServerState System.Int32
SetHostName
ShutdownTimeLimit System.Int32
SSIExecDisable
SSLAlwaysNegoClientCert
SSLCertHash
SslCtlIdentifier
SslCtlStoreName
SSLStoreName
TraceUriPrefix
UploadReadAheadSize System.Int32
UseDigestSSP
UseHostName
Win32Error


IIS Virtual Directory Properties

Optional

Name Type
AccessExecute
AccessFlags int
AccessNoPhysicalDir
AccessNoRemoteExecute
AccessNoRemoteRead
AccessNoRemoteScript
AccessNoRemoteWrite
AccessRead bool
AccessScript bool
AccessSource
AccessSSL
AccessSSL128
AccessSSLFlags
AccessSSLMapCert
AccessSSLNegotiateCert
AccessSSLRequireCert
AccessWrite
AdminACLBin
AnonymousPasswordSync bool
AnonymousUserName string
AnonymousUserPass
AppAllowClientDebug
AppAllowDebugging
AppFriendlyName
AppIsolated
AppOopRecoverLimit int
AppPackageID
AppPackageName
AppPoolId string
AppRoot string
AppWamClsid
AspAllowOutOfProcComponents bool
AspAllowSessionState bool
AspAppServiceFlags
AspBufferingLimit int
AspBufferingOn bool
AspCalcLineNumber bool
AspCodepage
AspDiskTemplateCacheDirectory string
AspEnableApplicationRestart bool
AspEnableAspHtmlFallback
AspEnableChunkedEncoding bool
AspEnableParentPaths
AspEnableSxs
AspEnableTracker
AspEnableTypelibCache bool
AspErrorsToNTLog
AspExceptionCatchEnable bool
AspExecuteInMTA
AspKeepSessionIDSecure int
AspLCID
AspLogErrorRequests bool
AspMaxDiskTemplateCacheFiles int
AspMaxRequestEntityAllowed int
AspPartitionID
AspProcessorThreadMax int
AspQueueConnectionTestTime int
AspQueueTimeout int
AspRequestQueueMax int
AspRunOnEndAnonymously bool
AspScriptEngineCacheMax int
AspScriptErrorMessage string
AspScriptErrorSentToBrowser bool
AspScriptFileCacheSize int
AspScriptLanguage string
AspScriptTimeout int
AspSessionMax int
AspSessionTimeout int
AspSxsName
AspTrackThreadingModel
AspUsePartition
AuthAnonymous bool
AuthBasic
AuthFlags int
AuthMD5
AuthNTLM
AuthPassport
AuthPersistence int
AuthPersistSingleRequest bool
AzEnable
AzImpersonationLevel
AzScopeName
AzStoreName
CacheControlCustom
CacheControlMaxAge
CacheControlNoCache
CacheISAPI bool
CGITimeout int
ContentIndexed
CreateCGIWithNewConsole
CreateProcessAsUser bool
DefaultDoc string
DefaultDocFooter
DefaultLogonDomain
DirBrowseFlags int
DirBrowseShowDate bool
DirBrowseShowExtension bool
DirBrowseShowLongDate
DirBrowseShowSize bool
DirBrowseShowTime bool
DisableStaticFileCache
DoDynamicCompression
DontLog
DoStaticCompression
EnableDefaultDoc bool
EnableDirBrowsing
EnableDocFooter
EnabledProtocols
EnableReverseDns
FrontPageWeb
HttpCustomHeaders string
HttpErrors object[]
HttpErrorsExistingResponse
HttpExpires string
HttpPics
HttpRedirect
IPSecurity __Comobject
KeyType string
LogonMethod int
MaxRequestEntityAllowed int
MimeMap
NTAuthenticationProviders string
PassportRequireADMapping int
Path string
PoolIdcTimeout
Realm
RedirectHeaders
ScriptMaps object[]
ShutdownTimeLimit int
SSIExecDisable
UNCPassword
UNCUserName
UploadReadAheadSize int
UseDigestSSP
Win32Error