Files
claudetools/scratch-preflight2.ps1
Howard Enos 2fd646218d sync: auto-sync from HOWARD-HOME at 2026-07-07 17:33:19
Author: Howard Enos
Machine: HOWARD-HOME
Timestamp: 2026-07-07 17:33:19
2026-07-07 17:33:56 -07:00

30 lines
1.7 KiB
PowerShell

$ErrorActionPreference='SilentlyContinue'
"==== A. WHAT USES EACH SERVER IP ===="
"-- DNS A records pointing at the server's IPs --"
$targets = '192.168.1.120','192.168.1.125','10.10.10.5'
Get-DnsServerResourceRecord -ZoneName 'TPS.local' -RRType A 2>$null |
Where-Object { $_.RecordData.IPv4Address.IPAddressToString -in $targets } |
Select-Object HostName,@{n='IP';e={$_.RecordData.IPv4Address.IPAddressToString}} |
Sort-Object IP | Format-Table -Auto | Out-String
"-- TCP listeners bound to a SPECIFIC IP (reveals services pinned to .120/.125/10.x) --"
Get-NetTCPConnection -State Listen 2>$null |
Where-Object { $_.LocalAddress -notin '0.0.0.0','::','127.0.0.1','::1' } |
Select-Object LocalAddress,LocalPort,@{n='Process';e={(Get-Process -Id $_.OwningProcess -ErrorAction SilentlyContinue).ProcessName}} |
Sort-Object LocalAddress,LocalPort | Format-Table -Auto | Out-String
"-- IIS websites + bindings (Essentials Remote Web Access, etc.) --"
Import-Module WebAdministration -ErrorAction SilentlyContinue
Get-Website 2>$null | Select-Object Name,State,@{n='Bindings';e={ ($_.bindings.Collection | ForEach-Object { $_.protocol + ':' + $_.bindingInformation }) -join ' | ' }} | Format-Table -Auto -Wrap | Out-String
"==== B. IS THE CA STILL ACTIVELY ISSUING? ===="
"-- Templates the CA is currently published to issue --"
certutil -CATemplates 2>&1 | Out-String
"-- MOST RECENT issued certs (highest RequestIDs = newest) --"
certutil -view -restrict "Disposition=20" -out "RequestID,CommonName,CertificateTemplate,NotAfter" csv 2>&1 | Select-Object -Last 15 | Out-String
"-- Any GPO that might drive cert autoenrollment --"
Get-GPO -All 2>$null | Select-Object DisplayName,ModificationTime | Sort-Object DisplayName | Format-Table -Auto | Out-String
"==== DONE ===="