> For the complete documentation index, see [llms.txt](https://docs.movebot.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.movebot.io/platform-guides/sharepoint/granting-access-to-all-sites-using-sharepoint-api-in-gcc-high-tenants.md).

# Granting access to all sites using SharePoint API in GCC High tenants

Migrating SharePoint sites in GCC High tenants requires providing Movebot access to the sites. This can be done by using PowerShell with an account that has appropriate permission levels.&#x20;

{% hint style="info" %}
If you do not have experience with PowerShell, consult someone in your organisation who does or have a chat with our team for help.&#x20;
{% endhint %}

1\. Install [PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.5) on your computer and connect to Microsoft Graph GCC High

```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

```

2. Identify your app & SharePoint resource

```powershell
# 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'"

```

3. Find the `Sites.FullControl.All` App role on SPO and assign it to your app

```powershell
# Locate the Sites.FullControl.All (application) role
$spoRole = $spoSp.AppRoles |
  Where-Object { $_.Value -eq "Sites.FullControl.All" -and $_.AllowedMemberTypes -contains "Application" }

# Grant that role to your app's service principal
New-MgServicePrincipalAppRoleAssignment `
  -ServicePrincipalId $sp.Id `
  -PrincipalId $sp.Id `
  -ResourceId $spoSp.Id `
  -AppRoleId $spoRole.Id

```

4. Verify the assignment

```powershell
Get-MgServicePrincipalAppRoleAssignment -ServicePrincipalId $sp.Id |
  Where-Object { $_.ResourceDisplayName -match "SharePoint" } |
  Select-Object ResourceDisplayName, AppRoleId, PrincipalDisplayName

```

You should see an assignment referencing SharePoint with an AppRoleId matching `$spoRole.Id`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.movebot.io/platform-guides/sharepoint/granting-access-to-all-sites-using-sharepoint-api-in-gcc-high-tenants.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
