Granting access to all sites using SharePoint API in GCC High tenants
Learn about granting Movebot access to all SharePoint sites in GCC High tenants by using Microsoft PowerShell.
# Install once (current user)
Install-Module Microsoft.Graph -Scope CurrentUser -Force
Import-Module Microsoft.Graph
# Connect to the GCC High cloud
Connect-MgGraph -Environment USGov `
-Scopes "Application.ReadWrite.All", "AppRoleAssignment.ReadWrite.All", "Directory.Read.All"
# (Optional) confirm cloud
(Get-MgContext).Environment
# Your Entra app's CLIENT ID
$appId = "<YOUR-APP-CLIENT-ID>"
# Your app's service principal
$sp = Get-MgServicePrincipal -Filter "appId eq '$appId'"
# SharePoint Online resource SP in M365
$spoSp = Get-MgServicePrincipal -Filter "appId eq '00000003-0000-0ff1-ce00-000000000000'"
Last updated