I wanted to take Michael Niehaus’s AutopilotBranding script one step further and determine what settings and languages to apply to a device based on it’s location. But how would we be able to determine a devices location during provisioning?
Using PowerShell we could easily get a devices location:
This works well, but then we are reliant on the API being available and not falling foul of any usage limitations (unless of course you pay for access). Another alternative, and the one I chose to go with, is to rely on the home location of the current Windows account. This is set when a user selects their region during OOBE and is easily accessed via the Get-WinHomeLocation command:
Nice. Now we can use the Geo ID or the HomeLocation as a reference in our Config.xml:
Why the underscore before the GeoID? Well XML does not support numbers as the name of an element and requires a character it does support to prefix the number.
You can find the full solution on GitHub.