Forum Discussion

John Reece's avatar
John Reece
Copper Contributor
May 17, 2020

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.

  • Manfred101's avatar
    Manfred101
    Iron Contributor

    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. 

     

    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

     

     

     

Resources