Last active
July 29, 2019 05:35
-
-
Save simonkuang/70ac44d4f49a2901ebece4d35d497c0f to your computer and use it in GitHub Desktop.
to resolve the windows names of PCs in local network
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Only for MacOS | |
brew install nmap | |
for i in $(nmap -p3389 192.168.1.0/24 | grep -B5 "3389/tcp open" | grep "report for" | awk "{print \$5}"); do | |
echo $i: $(smbutil status $i | awk '!(NR%3){print $2}') | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment