Forum Discussion
John Reece
May 17, 2020Copper Contributor
Powershell to confirm onedrive geolocation
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.
- EricStarkerCommunity Manager
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.
- Manfred101Iron Contributor
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.
Goodluck!
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