Subnet Ping Sweep

ProTips-31

Pro Tips with Esben #31

Similar to last time, we're using another action. This time we're going to use an action to ping sweep the subnet of an asset of your choosing and export it to a CSV file.

With a subnet sweep action, you'll be able to ping all of the IP addresses in a subnet of a specific asset and get an export to a CSV file so you can easily view, filter, and use it for anything else.

subnetsweep csv

Prerequisites & Script

To get the action working, there are a few things that need to be sorted. The first is that you'll need to download and configure a browser extension so that you can run actions. You can find all the info you need in the custom actions knowledgebase article.

Second, you will need to make sure the path to where the CSV file will be stored exists on your Lansweeper server. The default is C:\temp, so make sure that folder exists, or adjust the script and choose a different folder.

For the script, there isn't anything special you need to do. Simply download the script here and place it in your Lansweeper server's Actions folder (C:\Program Files (x86)\Lansweeper\Actions)

Subnet Sweep Custom Action

To create the custom action, head over to Configuration\Asset Pages and add a new action. In the Action area, add the following command.

powershell -noprofile -ExecutionPolicy bypass -command {actionpath}subnetsweep.ps1 -ip {ipaddress}

Once you execute the action, you'll see a PowerShell window pop-up which will stay blank for a couple of minutes as the script runs and pings all the IP addresses in the subnet. Once the sweep is completed, the PowerShell windows will automatically close and you'll find the CSV file in the above-mentioned location.

Esben from Lansweeper

About Esben

Technical Product Evangelist at Lansweeper

Maximizing IT Asset Management proficiency by empowering end-users to take full advantage of their toolset.

Share on facebook
Share on twitter
Share on linkedin
Share on reddit
Share on email

You may also like...

Try Lansweeper for Free

Learn why Lansweeper is used by thousands of enterprises worldwide.‚Äč