# Granting OneDrive Access

Migrating into and out of SharePoint with users requires the SharePoint admin registered with Movebot to have access to users' OneDrive accounts. In SharePoint, admins do not have access by default to individual OneDrive accounts so access will need to be granted.&#x20;

### Granting Access to an Individual User

As long as you are a licensed Microsoft 365 Global Administrator, you can take ownership of a user’s OneDrive by following these steps:

1\. Log into the **Microsoft 365 Admin Center** for your tenant

2\. Open **Active Users** under the **Users** tab and search for the user whose files you need

3\. Click on the Display name of the user

4\. Open the **OneDrive** settings tab

5\. Click **Create link to files**

Once the link appears, no further action is required.&#x20;

&#x20;

### Granting Access to all Users

For larger organizations, you can use PowerShell to automate granting permissions at scale.&#x20;

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

1\. Ensure you have the SharePoint PowerShell utilities installed:&#x20;

Open PowerShell as Administrator and run:

```powershell
Install-Module -Name Microsoft.Online.SharePoint.PowerShell
```

&#x20;2\. Create a new PowerShell Script in Notepad, substituting the fields as appropriate for your domain&#x20;

```powershell
#Set Runtime Parameters
$AdminSiteURL="https://couchdrop-admin.sharepoint.com"
$SiteCollAdmin="michael@couchdrop.onmicrosoft.com"

#Connect to SharePoint Online Admin Center
Connect-SPOService -Url $AdminSiteURL -Credential $SiteCollAdmin

$OneDriveSites = Get-SPOSite -Template "SPSPERS" -Limit ALL -IncludePersonalSite $True
Write-Host -f Yellow "Total Number of OneDrive Sites Found: "$OneDriveSites.count
​
ForEach($Site in $OneDriveSites)
{
	Write-Host -f Yellow "Adding admin to: " $Site.URL
	Set-SPOUser -Site $Site.Url -LoginName $SiteCollAdmin -IsSiteCollectionAdmin $True
}

Write-Host "Site Collection Admin Added Successfully!"
```

&#x20;3\. Run the PowerShell script. Once it has been completed, your SharePoint admin account should have access across the organization.&#x20;

{% hint style="info" %}
Please note: Currently, this script only works in **Windows** PowerShell.
{% endhint %}

4\. Be sure to include the `-admin` part of the URL when configuring `$AdminSiteURL`\
5\. If your account has 2FA configured, the `-credential` argument should be removed.\
\
Tags: sharepoint legacy\_sharepoint onprem\_sharepoint onedrive<br>
