Commands › SharePoint Online

Get-SPOUserOneDriveLocation

SharePoint Online Microsoft.Online.SharePoint.PowerShell Get-*

This cmdlet will return the user principal name, current location, and corresponding OneDrive for Business url, and the site ID. This cmdlet only supports Multi-Geo OneDrive sites.

Quick start script

# Get-SPOUserOneDriveLocation — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-SPOService -Url https://$org-admin.sharepoint.com

# 2. Run and inspect
Get-SPOUserOneDriveLocation -UserPrincipalName <String> | Format-List

# 3. Export for evidence / drift tracking
Get-SPOUserOneDriveLocation | Export-Clixml .\SPOUserOneDriveLocation-$(Get-Date -Format yyyyMMdd).xml

Syntax

Get-SPOUserOneDriveLocation -UserPrincipalName <String> [<CommonParameters>]

Parameters (1)

ParameterTypeRequiredWhat it controls
-UserPrincipalName String yes UserPrincipalName or UPN defined for the specific user on the SPO tenant.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.