Purpose
CloudM Migrate utilizes Modern Authentication to connect to Microsoft 365 source and destination platforms. This approach replaces passwords with certificates, which only have permissions necessary for migration.
This documentation outlines how to manually configure:
-
An Azure AD Application with limited scopes
-
A PFX certificate
-
Scoped permissions using security groups
Note:
- This guide is specific to export scenarios from Microsoft 365. Additionally, it is recommended to use the PowerShell method detailed in the below article.Azure AD Application - Limited Scopes - PowerShell Method
- As scopes are being limited, CloudM Migrate’s connection tests will show warnings/errors regarding the missing scopes, but these may be ignored as the migration will still work.
Prerequisites
CloudM Migrate Source Administrator Configuration
Our documentation suggests that a Global Administrator is required to configure the authentication to an Office 365 source or destination, however, when you are limiting scopes the following applies:
-
A Global Administrator is required only to create the Azure AD application
-
The below field within the source connection in CloudM Migrate can contain any admin address (not GA) once you have the other required criteria to authenticate.
- Note: If you are migrating Microsoft Teams a Global Admin account is required.
Certificate Generation
To create a new certificate and key, launch PowerShell as an administrator and run the below commands.
Exchange Online
Restricting app access to Exchange Online cannot be done through the Microsoft 365 user interface. This section explains how to achieve it using PowerShell, specifically with the ExchangeOnlineManagement
module and the New-ApplicationAccessPolicy
cmdlet.
SharePoint Online
SharePoint Online does not provide a user interface for restricting app access. This section outlines how to configure access using PowerShell, leveraging the New-MgSitePermission
cmdlet along with the following Microsoft Graph modules:
-
Microsoft.Graph.Identity.DirectoryManagement
-
Microsoft.Graph.Applications
-
Microsoft.Graph.Files
-
Microsoft.Graph.Sites
Create Microsoft Azure AD Application
-
Choose Accounts in this organizational directory only (Single tenant).
-
Click Register.
-
Under Application ID URI.
-
click Add, then Save.
-
In Overview, click Add Certificate or Secret
-
Click Certificates > Upload Certificate
- Upload the certificate previously created then click on Add.
API Permissions
- Click on API Permissions
- Remove default permission User.Read
-
Add a Permission (SharePoint)
- Under Microsoft APIs select SharePoint
- Application Permissions
- Select “Sites.Selected”
- Add Permissions
-
Click on API Permissions
- Add a Permission (Microsoft Graph)
- Under Microsoft Graph select Application Permissions
- Select Files.Read.All and User.Read.All
- Add Permissions
-
Click on API Permissions
- Add a Permission (Exchange)
- Select APIs my Organization uses
- Select Office 365 Exchange Online
- Application Permissions
- Select ‘full_access_as_app’
Once the permissions are added, click on Grant Admin Consent. You should now see the below. Note, these are the minimum scopes required. User.Read.All is required to check that the user exists in the source and Files.Read.All to resolve the users OneDrive Url/Sites Url
Exchange Online
-
Create a Mail-enabled Security Group:
-
Assign Owners
-
Add Members : This will be the users you are migrating data from.
-
Note the group's email address
-
-
Run the following PowerShell, replacing the AppId and PolicyScopeGroupId with your Application Id (Client Id) and group email address.
Note: When running the below PowerShell commands, please make sure to authenticate with a Global Admin account.
OneDrive and SharePoint Online
Requirements
-
Executing user must be a Site Collection Administrator
-
Site ID is required (can be retrieved via PowerShell or Microsoft Graph Explorer)
- If a 403 error is returned, it will be required to add the user running the script as a site collection administrator to then add the permission using the New-MgSitePermission command. The user can then be removed from the site collection.
OneDrive Example Script
This example script get's the site collection for user@domain.com and grants the appropriate permissions in order to migrate. You will need to replace the $ClientAppId variable with your application client ID and the $user variable with your users email address.
SharePoint Example Script
The below example script get's the site collection of a specific site ID and grants the appropriate permissions in order to migrate. You will need to set the $siteId variable to the ID of the site you wish to grant access to and the $ClientAppId variable to your application client ID.
$Environment = "Global"
$ClientAppId = "c38c5334-ae03-4a18-a3a9-7ba9c441e07b"
$neededScopes = @("Group.Read.All", "Sites.FullControl.All")
$siteId = <Site ID Goes here>
Connect-MgGraph -Environment $Environment -Scope $neededScopes -NoWelcome
$params = @{
roles = @("FullControl")
grantedToIdentities = @(
@{
application = @{
id = $ClientAppId
displayName = "CloudM-Limited-$($ClientAppId)"
}
}
)
}
$permission = New-MgSitePermission -SiteId $siteId -BodyParameter $params
Write-Host "Site ID: $siteId"
Write-Host "Permission ID: $($permission.Id)"
Examples
The below images show examples of entities being migrated. The successful entities are items that the app registration has been granted access to with limited scopes.