Detecting out of Country Devices

MisterJ2020 0 Reputation points
2023-03-15T17:32:15.3+00:00

Good Afternoon. My company uses W10 and W11 devices. We're concerned that some users may be taking devices out of the country and doing work. Are there any geolocation services that could be activated to check a user's location at regular intervals and report back to us if a device is out of the USA?

Windows 10 Security
Windows 10 Security
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Security: The precautions taken to guard against crime, attack, sabotage, espionage, or another threat.
2,820 questions
Microsoft Intune Security
Microsoft Intune Security
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Security: The precautions taken to guard against crime, attack, sabotage, espionage, or another threat.
370 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 44,081 Reputation points
    2023-03-16T15:26:17.7066667+00:00

    Hello there,

    You can turn on the Windows location service and privacy and then fetch the location details periodically.

    Microsoft operates a location service that helps determine the precise geographic location of your Windows device.

    An example of using the System.Device.Location method, this should be what you're looking for.

    Add-Type -AssemblyName System.Device #Required to access System.Device.Location namespace

    $GeoWatcher = New-Object System.Device.Location.GeoCoordinateWatcher #Create the required object

    $GeoWatcher.Start() #Begin resolving current locaton

    while (($GeoWatcher.Status -ne 'Ready') -and ($GeoWatcher.Permission -ne 'Denied')) {

    Start-Sleep -Milliseconds 100 #Wait for discovery.
    

    }

    if ($GeoWatcher.Permission -eq 'Denied'){

    Write-Error 'Access Denied for Location Information'
    

    } else {

    $GeoWatcher.Position.Location | Select Latitude,Longitude #Select the relevent results.
    

    }

    Hope this resolves your Query !!

    --If the reply is helpful, please Upvote and Accept it as an answer--

    0 comments No comments