To update the UsageLocation of an Active Directory (AD) user using PowerShell, you typically need to use the Set-MsolUser cmdlet from the Microsoft Online Services Module for PowerShell (MSOnline) or the Set-AzureADUser cmdlet from the AzureAD module or AzureAD.Standard.Preview module if you're working with Azure AD.
Here’s how you can do it with both methods:
Method 1: Using the MSOnline module (Set-MsolUser) Install and Import the MSOnline module (if not already installed): Install-Module -Name MSOnline Import-Module MSOnline