To export OneDrive URLs for all users in a Microsoft 365 environment, you can use PowerShell with the Microsoft Graph API or SharePoint Online Management Shell. Here’s how you can do it:
1️⃣Using PowerShell and SharePoint Online Management Shell
This method retrieves all user OneDrive URLs in a CSV file.
Steps to Export OneDrive URLs for All Users:
🚀 Install & Connect to SharePoint Online
- Open PowerShell as an administrator and run:
Install-Module -Name Microsoft.Online.SharePoint.PowerShell -Force - AllowClobber
Import-Module Microsoft.Online.SharePoint.PowerShell
Connect-SPOService -Url https://yourdomain-admin.sharepoint.com
- Replace
yourdomain
with your actual Microsoft 365 tenant name.
🚀 Retrieve and Export OneDrive URLs
- Run the following command to get all users' OneDrive URLs and export them to a CSV file:
Get-SPOUser -Site https://yourdomain-my.sharepoint.com |
Select-Object DisplayName, LoginName, PersonalUrl |
Export-Csv -Path C:\OneDriveURLs.csv -NoTypeInformation
yourdomain
with your Microsoft 365 tenant name.OneDriveURLs.csv
will be saved in C:\
2️⃣Using Microsoft Graph PowerShell
For environments using Azure AD and Microsoft Graph, follow these steps:
1️⃣ Install and Connect to Microsoft Graph
2️⃣ Export OneDrive URLs
- Adjust
yourdomain
accordingly.
This script helps IT admins easily retrieve and export OneDrive URLs for all users in a Microsoft 365 organization. You can use these URLs for auditing, migrations, or management tasks.
0 Comments