19 lines
1.5 KiB
PowerShell
19 lines
1.5 KiB
PowerShell
$ErrorActionPreference = 'Continue'
|
|
Import-Module WebAdministration
|
|
Write-Output '=== App pools (Exchange PowerShell) ==='
|
|
Get-ChildItem IIS:\AppPools | Where-Object Name -match 'PowerShell|MSExchange' | Select-Object Name, State | Format-Table -AutoSize
|
|
Write-Output '=== PowerShell vdirs ==='
|
|
Get-WebApplication -Name PowerShell | Format-List Path, ApplicationPool, PhysicalPath, ItemXPath
|
|
Write-Output '=== Default Web Site + Back End bindings ==='
|
|
Get-Website | Select-Object Name, State, @{n='Bind';e={($_.bindings.Collection | ForEach-Object bindingInformation) -join ' ; '}} | Format-Table -AutoSize
|
|
Write-Output '=== Auth on Default Web Site/PowerShell ==='
|
|
foreach ($a in 'anonymousAuthentication','windowsAuthentication','basicAuthentication') {
|
|
$v = Get-WebConfigurationProperty -Filter "system.webServer/security/authentication/$a" -PSPath 'IIS:\Sites\Default Web Site\PowerShell' -Name enabled -ErrorAction SilentlyContinue
|
|
Write-Output "DWS/PowerShell $a = $($v.Value)"
|
|
}
|
|
Write-Output '=== SSL flags on DWS/PowerShell ==='
|
|
(Get-WebConfigurationProperty -Filter 'system.webServer/security/access' -PSPath 'IIS:\Sites\Default Web Site\PowerShell' -Name sslFlags -ErrorAction SilentlyContinue)
|
|
Write-Output '=== recent HTTP 4xx/5xx to /powershell (IIS log tail) ==='
|
|
$log = Get-ChildItem 'C:\inetpub\logs\LogFiles\W3SVC1' -Filter *.log -ErrorAction SilentlyContinue | Sort-Object LastWriteTime -Descending | Select-Object -First 1
|
|
if ($log) { Get-Content $log.FullName -Tail 400 | Select-String -SimpleMatch '/powershell' | Select-Object -Last 10 }
|