From 5aa9ba219a34432e0c8acf1d1ed8500ae8772226 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Fri, 17 May 2024 14:23:02 +0200 Subject: [PATCH] Add scan-network.ps1 --- scripts/scan-network.ps1 | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 scripts/scan-network.ps1 diff --git a/scripts/scan-network.ps1 b/scripts/scan-network.ps1 new file mode 100644 index 00000000..b488c004 --- /dev/null +++ b/scripts/scan-network.ps1 @@ -0,0 +1,13 @@ +$a = Get-NetIPAddress | Where-Object -FilterScript { $_.SuffixOrigin -eq "DHCP" -or $_.SuffixOrigin -eq "manual" } # | Format-Table -property IPAddress -autoSize + +$arguments = "-sT -T3" # Set sane defaults for command string +$location = "nmap" # In case nmap is not in PATH +$targets = "" + +foreach ( $i in $a ) { + $s = $i.IPAddress + "/" + $i.PrefixLength + $targets = $targets + " " + $s +} +$arguments = $arguments + " " + $targets + +Start-Process $location -ArgumentList $arguments -Wait