Jump to content

Move computer based on public IP


Recommended Posts

This script moves the computer (only Windows workstations) to the location matching the router’s public IP. It will not change client and if you want to have a Roaming location for certain clients, it will see if public IP matches any location for that client/s and if not, it will move it to “Roaming” location.

Consider this script as a draft / work in progress. Of course this script can be improved a lot. Any suggestion / modification will be really appreciated.

Thank you

Move Computer to Location IP.xml.zip

  • Like 1
Link to post
Share on other sites
  • 4 weeks later...

Interesting script and we would like to do something similar where we auto-deploy an MSI agent, the computer will be placed in a default mainoffice location, then the script will pick it up and place it in its correct location depending if it matches the ip range of the probe.

In line 2 you are matching clientid to 11, but I cannot understand why specifically 11? Is that hardcoded as you are testing on a specific client or relates to roaming (standard built-in number in automate)?

Thanks,
Kevin

Link to post
Share on other sites

Hi Kevin

Our client with clientID = 11 has the Roaming location for all computers that do not match any other location public IP, for the rest of our clients, those computers are placed in Main location.

Feel free to change that for an IF statement to see if customer has a Roaming location or if you want to use an EDF.

Remember this is a work in progress and any suggestion would be really appreciated.

 

Thanks

Link to post
Share on other sites
  • 2 months later...

So i modified this to move device to other clients and this works well since i only want to run it on the "new computers" location to sort it. This works but it only moves the location and im looking for guidance on how to get a client based off of a location if they don't have unique names. Most that are single site are just "main"

Edited by sgtwtf
fixed some stuff and got further and my question completely changed.
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...