Files
claudetools/.neptune-iis-probe.ps1
Howard Enos 0e244a610f sync: auto-sync from HOWARD-HOME at 2026-07-15 12:21:30
Author: Howard Enos
Machine: HOWARD-HOME
Timestamp: 2026-07-15 12:21:30
2026-07-15 12:22:01 -07:00

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 }