This script is pretty simple but with great power to the DBA´s. How many times did you need to search for SQL Server Instances across the network ? I believe every DBA already had to do this at least once.
With PowerShell this process is , as always, pretty simple to do .
The script :
In the first line I define the range or 1 to 254.
In the second line I am excluding the IP that is running the script, in my cases is the last number 4 , or xxx.xxx.xxx.4
In the third line I am defining the variable IP to serach in that specific IP. Of course yoou need to change the xxx.xxx.xxx to your network.
In the fourth line I am pinging the IP and in the fifth line searching for any SQL Server Service.
running this script :
You can also see the progress , just change the verbose preference to Continue :
and if you want you can just see the progress and output the Ip that had SQL Server Service to a txt change the line :
Just remembering that you need to run this script in PowerShell as administrator
Simple, Clean and Fast. Classic Powershell