Get-UserOneDriveLocation
SharePoint Online: Gets user's OneDrive location
#Requires -Version 5.1
#Requires -Modules Microsoft.Online.SharePoint.PowerShell
[CmdletBinding()]
Param(
[Parameter(Mandatory = $true)]
[string]$UserPrincipalName
)
Process {
try {
$result = Get-SPOUserOneDriveLocation -UserPrincipalName $UserPrincipalName -ErrorAction Stop | Select-Object *
if ($null -ne $result) { foreach ($item in $result) { $item | Add-Member -NotePropertyName Timestamp -NotePropertyValue (Get-Date -Format "yyyy-MM-dd HH:mm:ss") -PassThru -Force } }
}
catch { throw }
}User principal name to look up