Powershell to confirm onedrive geolocation

Copper Contributor

Running geo-migrations and can confirm status of move, but would like to run a report against the same list of users that confirms the current geolocation for each user's OneDrive.

2 Replies

@John Reece 

Hello! You've posted your question in the Community Discussion space, which is intended for discussion around the Tech Community website itself, not product questions. I'm moving your question to the PowerShell space - please post PowerShell questions here in the future. 

@John Reece 

I don’t have a multi-geo tenant so I was unable to check the output, but I think the script below is showing the data where you looking for. 



Grtz, Manfred de Laat



$cred =  Get-Credential
$url = "https://xxxxxxxxx-admin.sharepoint.com/"
Connect-SPOService $url -Credential $cred
Connect-MsolService -Credential $cred

$Users = Get-MsolUser 
$UsersMoveState = @()
$UsersOneDriveLocation = @()

foreach($User in $Users){
    $UsersMoveState += Get-SPOUserAndContentMoveState -UserPrincipalName $user.UserPrincipalName
    $UsersOneDriveLocation += Get-SPOUserOneDriveLocation -UserPrincipalName $user.UserPrincipalName
write-host $UsersMoveState,$UserOneDriveLocation