Skip to main content
All CollectionsMigratePowerShellImport from Box.com
Impersonate an owner for Box.com migration
Impersonate an owner for Box.com migration
Updated over 2 weeks ago

This command will allow you to act as your Box.com owners which is useful since your owners are generally unable to run the migration themselves.

When you try to run a Box.com migration with any non-owner role (including admin), the migration will fail, and you will see the following message:

You are not authorized to perform the requested operation.

As an admin, you need to add the parameter -UserEmail as follows:

Import all documents from another user in admin mode

$box = Connect-Box -Email [email protected] -Admin
$dstSite = Connect-Site -Url "https://mycompanysite-my-sharepoint.com" -Browser
$dstList = Get-List -Name "Documents" -Site $dstSite
$copysettings = New-CopySettings -OnContentItemExists IncrementalUpdate
Import-BoxDocument -Box $box -UserEmail Ownerofthefile@company -DestinationList $dstList -DestinationFolder "FromBox"

Connection with password

Import-Module Sharegate
$box = Connect-Box -Email [email protected] -Admin
$mypassword = ConvertTo-SecureString 'mypassword' -AsPlainText -Force
$dstSite = Connect-Site -Url "https://mycompanysite-my-sharepoint.com" -Username "[email protected]" -Password $mypassword
$dstList = Get-List -Name "Documents" -Site $dstSite
Import-BoxDocument -Box $box -UserEmail [email protected] -DestinationList $dstList -DestinationFolder "FromBox"

Note: -DestinationFolder cannot be used to create new folders at the destination.

Did this answer your question?