We've updated our file storage system, so some links may no longer work. If you need a file, just email us at support@secomea.com—we’re happy to help!

Set a group domain location with SCIM

Prev Next

Set a group domain location with SCIM

For Setting the Location of Group, follow the below steps

Save the following as Set-GroupPath.ps1:

$TenantId   = "your-tenant-id-here"
$Groups = @(
    @{
        GroupId     = "group-object-id-1"
        Description = "This is Group One"
        Path        = "Europe/Groups"
    },
    @{
        GroupId     = "group-object-id-2"
        Description = "This is Group Two"
        Path        = "Europe/Groups"
    }
    # Add more groups as needed
)
# ---- DO NOT EDIT BELOW THIS LINE ----
Write-Host "Connecting to Microsoft Graph..." -ForegroundColor Cyan
Connect-MgGraph  -TenantId $TenantId -Scopes "Group.ReadWrite.All" -NoWelcome
Write-Host "Starting group updates..." -ForegroundColor Cyan
Write-Host "----------------------------------------"
$success = 0
$failed  = 0
foreach ($group in $Groups) {
    try {
        $body = @{
            description = "$($group.Description)||$($group.Path)"
        } | ConvertTo-Json
        Invoke-MgGraphRequest -Method PATCH `
            -Uri "https://graph.microsoft.com/v1.0/groups/$($group.GroupId)" `
            -Body $body `
            -ContentType "application/json"
        Write-Host "SUCCESS: GroupId=$($group.GroupId) | Description='$($group.Description)' | Path='$($group.Path)'" -ForegroundColor Green
        $success++
    }
    catch {
        Write-Host "FAILED:  GroupId=$($group.GroupId) | Error: $($_.Exception.Message)" -ForegroundColor Red
        $failed++
    }
}
Write-Host "----------------------------------------"
Write-Host "Done! Success: $success | Failed: $failed" -ForegroundColor Cyan
Disconnect-MgGraph

Step-by-Step Instructions

Step 1 — Find Your Tenant ID

  1. Go to Azure Portal
  2. Navigate to Microsoft Entra ID → Overview
  3. Copy the Tenant ID

Step 2 — Edit the Script (For Example)

Update the TenantId and Groups section:

$TenantId = "aaaaaaaa-1111-2222-3333-444444444444"
$Groups = @(
    @{
        GroupId     = "bbbbbbbb-1111-2222-3333-444444444444"
        Description = "LMU Users Group"
        Path        = "Europe/Denmark/Copenhagen"
    },
    @{
        GroupId     = "cccccccc-1111-2222-3333-444444444444"
        Description = "Admin Users Group"
        Path        = "Europe/Denmark/Aarhus"
    }
)

Step 3— Run the Script

./Set-GroupPath.ps1

Sign in using your Microsoft Entra ID administrator account when prompted.

Step 4 – Verify that the group has gotten the path assigned.

This can be done via Provision on Demand in Entra, or in Secomea’s system once the group has been provisioned.