Add Find-RDP Script
This commit is contained in:
commit
98d12ffbe9
11
Find-RDP.ps1
Normal file
11
Find-RDP.ps1
Normal 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
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user