Commands › SharePoint Online
Get-SPOUserOneDriveLocation
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)
Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.