commit 98d12ffbe99e2fb1bf0a2bd86280766316573930 Author: Ben Hays Date: Tue Nov 7 21:36:39 2023 -0500 Add Find-RDP Script diff --git a/Find-RDP.ps1 b/Find-RDP.ps1 new file mode 100644 index 0000000..c18fc58 --- /dev/null +++ b/Find-RDP.ps1 @@ -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 + } +}