Category filter

Find the location of a Windows device using its IP address

Keeping track of the location and usage of company-owned devices is becoming increasingly important in today’s mobile and connected world. Having an eye on the type and location of the network that the employees who are working remotely is of utmost importance to reduce the risks of data breach and vulnerabilities. With Hexnode UEM, IT admins can now easily fetch the location, time zone, hostname, etc., of a Windows device using its IP address by executing custom scripts.

Disclaimer:

The sample scripts provided below are adapted from third-party open-source sites.

PowerShell script to find the location of a Windows device using its IP address

Use the following script to find the location of a Windows device using its IP address.

Along with the IP address of your Windows device, the script fetches the following data.

  • Hostname: displays the name by which the device identifies itself on the internet.
  • City: displays the city where the device currently resides.
  • Region: displays the state where the device resides.
  • Country: displays the country in which the device resides.
  • Loc: displays the latitude and longitude of the location where the device resides.
  • Org: displays the name of the network operator to which the device is connected.
  • Postal: displays the pin code of the location where the device resides.
  • Time zone: displays the time zone of the location where the device resides.
Notes:

  • It is recommended to manually validate the script execution on a system before executing the action in bulk.
  • Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.

  • Sample Script Repository