How do we check the current value of a user's UsageLocation attribute in Azure AD?
6 min
overview you can read and set a user's azure ad usagelocation directly through the azure property on the user object in activate this is useful when you need to confirm that azure ad connect has synchronised the value, such as in teams ddi provisioning workflows where dial plans depend on usagelocation being set correctly reading the usagelocation value use the following script to read the current value trace writeline(u properties\["azure usagelocation"] value tostring()); setting the usagelocation value use the following script to set the value u properties\["azure usagelocation"] value = "nz"; u setinfo(); notes msexchusagelocation in on premises active directory maps to usagelocation in azure ad this can be useful when waiting for azure ad connect to synchronise updates before continuing a provisioning workflow in scenarios such as teams ddi allocation, ensuring the value is present in azure ad can help confirm that dial plans will apply correctly additional detail this approach is not limited to usagelocation additional microsoft graph user properties can also be exposed through the azure schema and then read or set in script for example u properties\["azure employeeid"] value further testing confirmed that you can add additional graph properties into azure/customschema and then read or set them within script as needed examples mentioned include proxyaddresses mail employeeid summary use u properties\["azure usagelocation"] to read or set the azure ad usagelocation value this is helpful for checking whether synchronisation to azure ad has completed other graph backed user properties can also be added to azure/customschema and used in the same way