Skip to content

Get-MSTMultiGeoRegion

Teams: Get multi-geo region for users or groups

#Requires -Version 5.1

[CmdletBinding()]
Param(
    [Parameter(Mandatory = $true)]
    [string]$ObjectId,
    [Parameter(Mandatory = $true)]
    [ValidateSet('Group', 'User')]
    [string]$ObjectType
)

Process {
    try {
        [hashtable]$cmdArgs = @{'ErrorAction' = 'Stop'; 'EntityId' = $ObjectId; 'EntityType' = $ObjectType}

        $result = Get-MultiGeoRegion @cmdArgs | Select-Object *

        if ($null -eq $result) {
            Write-Output "No multi-geo region found"
            return
        }
        $result | Add-Member -NotePropertyName Timestamp -NotePropertyValue (Get-Date -Format 'yyyy-MM-dd HH:mm:ss') -PassThru -Force
    }
    catch { throw }
}

Group or user ID

Specify whether the object is a Group or User

An interactive directory of PowerShell scripts.