It seems like when using the Azure Portal web site, the region will be set as “United State” by default.
Connect-AzAccount
$token = (Get-AzAccessToken).Token
$uri = "https://management.azure.com/subscriptions/{SUBSCRIPTIONID}/resourceGroups/{RESOURCEGROUP}/providers/Microsoft.AzureActiveDirectory/guestUsages/{TENANTNAME}.onmicrosoft.com?api-version=2020-05-01-preview"
$body = @{
id = "/subscriptions/{SUBSCRIPTIONID}/resourceGroups/{RESOURCEGROUP}/providers/Microsoft.AzureActiveDirectory/guestUsages/{TENANTNAME}.onmicrosoft.com"
name = "{TENANTNAME}.onmicrosoft.com"
location = "Europe"
tags = @{}
type = "Microsoft.AzureActiveDirectory/GuestUsages"
properties = @{
tenantId = "{TENANTID}"
}
}
$headers = @{
Authorization = "Bearer $Bearer"
}
Invoke-RestMethod -Uri $uri -Method Put -Body ($body | ConvertTo-Json -Depth 10) -ContentType "application/json" -Headers $headers