Add Find-RDP Script

This commit is contained in:
Ben Hays 2023-11-07 21:36:39 -05:00
commit 98d12ffbe9

11
Find-RDP.ps1 Normal file
View File

@ -0,0 +1,11 @@
# Find-RDP.ps1
# (c) Ben Hays, 2023
# Description: Find all the computers joined to an AD domain that are running RDP
$computers = Get-ADComputer -Filter *
foreach ($Name in $computers.DNSHostName) {
$rdpSuccess = Test-Connection -TargetName $Name -TimeoutSeconds 2 -TcpPort 3389 -Quiet
if ($rdpSuccess) {
Write-Output $Name
}
}