# for each of the found sites perform a few simple steps get website | ForEach-Object-Process { # getting application path to character variable $ xPath = "IIS: \ sites \" + $ _. Name # transition in the IIS $ xPath namespace cd $ xPath # output for clarity, where we hit $ xPath # getting a collection of web applications in the current site $ myWebApp = get-webApplication # output all members of the collection $ myWebApp }
(Get-WebConfigurationProperty -Filter /system.webServer/security/authentication/basicAuthentication -Name Enabled -PSPath IIS: \ sites \ "Exchange Back End" -location $ WebApp.Path) .value
get-webSite cd IIS: \ Sites \ "Exchange Back End" get-webApplication | ForEach-Object -process { $ propPath = $ _. Path $ propAA = (Get-WebConfigurationProperty -Filter /system.webServer/security/authentication/anonymousAuthentication -Name Enabled -PSPath IIS: \ sites \ "Exchange Back End" -location $ _. Path) .value $ propBA = (Get-WebConfigurationProperty -Filter /system.webServer/security/authentication/basicAuthentication -Name Enabled -PSPath IIS: \ sites \ "Exchange Back End" -location $ _. Path) .value $ propCA = (Get-WebConfigurationProperty -Filter /system.webServer/security/authentication/clientCertificateMappingAuthentication -Name Enabled -PSPath IIS: \ sites \ "Exchange Back End" -location $ _. Path) .value $ propDA = (Get-WebConfigurationProperty -Filter /system.webServer/security/authentication/digestAuthentication -Name Enabled -PSPath IIS: \ sites \ "Exchange Back End" -location $ _. Path) .value $ propIA = (Get-WebConfigurationProperty -Filter /system.webServer/security/authentication/iisClientCertificateMappingAuthentication -Name Enabled -PSPath IIS: \ sites \ "Exchange Back End" -location $ _. Path) .value $ propWA = (Get-WebConfigurationProperty -Filter /system.webServer/security/authentication/windowsAuthentication -Name Enabled -PSPath IIS: \ sites \ "Exchange Back End" -location $ _. Path) .value $ _. Path; $ propAA; $ propBA; $ propCA; $ propDA; $ propIA; $ propWA; }
# Script text get-webSite cd IIS: \ Sites \ "Exchange Back End" $ myWebApp = get-webApplication $ myWebApp | Format-Table -AutoSize Path, @ {Label = "anonim:"; Expression = {(Get-WebConfigurationProperty -Filter /system.webServer/security/authentication/anonymousAuthentication -Name Enabled -PSPath IIS: \ sites \ "Exchange Back End" -location $ _. Path) .value}}, @ {Label = "Basic:"; Expression = {(Get-WebConfigurationProperty -Filter /system.webServer/security/authentication/basicAuthentication -Name Enabled -PSPath IIS: \ sites \ "Exchange Back End" -location $ _. Path) .value}}, @ {Label = "ClientCert:"; Expression = {(Get-WebConfigurationProperty -Filter /system.webServer/security/authentication/clientCertificateMappingAuthentication -Name Enabled -PSPath IIS: \ sites \ "Exchange Back End" -location $ _. Path) .value}}, @ {Label = "Digest:"; Expression = {(Get-WebConfigurationProperty -Filter /system.webServer/security/authentication/digestAuthentication -Name Enabled -PSPath IIS: \ sites \ "Exchange Back End" -location $ _. Path) .value}}, @ {Label = "IIS client Cert:"; Expression = {(Get-WebConfigurationProperty -Filter /system.webServer/security/authentication/iisClientCertificateMappingAuthentication -Name Enabled -PSPath IIS: \ sites \ "Exchange Back End" -location $ _. Path) .value}}, @ {Label = "Windows"; Expression = {(Get-WebConfigurationProperty -Filter /system.webServer/security/authentication/windowsAuthentication -Name Enabled -PSPath IIS: \ sites \ "Exchange Back End" -location $ _. Path) .value}}, @ {Label = "SSL Flags"; Expression = {(Get-WebConfigurationProperty -Filter /system.webServer/security/access -Name * -PSPath IIS: \ sites \ "Exchange Back End" -location $ _. Path) .SSLflags}} cd IIS: \ Sites \ "Default Web Site" $ myWebApp = get-webApplication $ myWebApp | Format-Table -AutoSize Path, @ {Label = "anonim:"; Expression = {(Get-WebConfigurationProperty -Filter /system.webServer/security/authentication/anonymousAuthentication -Name Enabled -PSPath IIS: \ sites \ "Default Web Site" -location $ _. Path) .value}}, @ {Label = "Basic:"; Expression = {(Get-WebConfigurationProperty -Filter /system.webServer/security/authentication/basicAuthentication -Name Enabled -PSPath IIS: \ sites \ "Default Web Site" -location $ _. Path) .value}}, @ {Label = "ClientCert:"; Expression = {(Get-WebConfigurationProperty -Filter /system.webServer/security/authentication/clientCertificateMappingAuthentication -Name Enabled -PSPath IIS: \ sites \ "Default Web Site" -location $ _. Path) .value}}, @ {Label = "Digest:"; Expression = {(Get-WebConfigurationProperty -Filter /system.webServer/security/authentication/digestAuthentication -Name Enabled -PSPath IIS: \ sites \ "Default Web Site" -location $ _. Path) .value}}, @ {Label = "IIS client Cert:"; Expression = {(Get-WebConfigurationProperty -Filter /system.webServer/security/authentication/iisClientCertificateMappingAuthentication -Name Enabled -PSPath IIS: \ sites \ "Default Web Site" -location $ _. Path) .value}}, @ {Label = "Windows"; Expression = {(Get-WebConfigurationProperty -Filter /system.webServer/security/authentication/windowsAuthentication -Name Enabled -PSPath IIS: \ sites \ "Default Web Site" -location $ _. Path) .value}}, @ {Label = "SSL Flags"; Expression = {(Get-WebConfigurationProperty -Filter /system.webServer/security/access -Name * -PSPath IIS: \ sites \ "Default Web Site" -location $ _. Path) .SSLflags}}
get website | ForEach-Object-Process { $ xSite = "IIS: \ sites \" + $ _. Name cd $ xSite $ xSite $ myWebApp = get-webApplication $ myWebApp | Format-Table -AutoSize Path, @ {Label = "anonim:"; Expression = {(Get-WebConfigurationProperty -Filter /system.webServer/security/authentication/anonymousAuthentication -Name Enabled -PSPath $ xSite -location $ _. Path) .value}}, @ {Label = "Basic:"; Expression = {(Get-WebConfigurationProperty -Filter /system.webServer/security/authentication/basicAuthentication -Name Enabled -PSPath $ xSite -location $ _. Path) .value}}, @ {Label = "ClientCert:"; Expression = {(Get-WebConfigurationProperty -Filter /system.webServer/security/authentication/clientCertificateMappingAuthentication -Name Enabled -PSPath $ xSite -location $ _. Path) .value}}, @ {Label = "Digest:"; Expression = {(Get-WebConfigurationProperty -Filter /system.webServer/security/authentication/digestAuthentication -Name Enabled -PSPath $ xSite -location $ _. Path) .value}}, @ {Label = "IIS client Cert:"; Expression = {(Get-WebConfigurationProperty -Filter /system.webServer/security/authentication/iisClientCertificateMappingAuthentication -Name Enabled -PSPath $ xSite -location $ _. Path) .value}}, @ {Label = "Windows"; Expression = {(Get-WebConfigurationProperty -Filter /system.webServer/security/authentication/windowsAuthentication -Name Enabled -PSPath $ xSite -location $ _. Path) .value}}, @ {Label = "SSL Flags"; Expression = {(Get-WebConfigurationProperty -Filter /system.webServer/security/access -Name * -PSPath $ xSite -location $ _. Path) .SSLflags}} }
Source: https://habr.com/ru/post/204454/
All Articles