This command will allow you to impersonate the Owner in order to properly run a Box.com migration. This is useful when the Owner is 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 switch -UserEmail as follows:
Import all documents from another user in Admin mode
$box = Connect-Box -Email adminemail@company.com -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 adminemail@company.com -Admin
$mypassword = ConvertTo-SecureString "mypassword" -AsPlainText -Force
$dstSite = Connect-Site -Url "https://mycompanysite-my-sharepoint.com" -Username "Admin@company.com" -Password $mypassword
$dstList = Get-List -Name "Documents" -Site $dstSite
Import-BoxDocument -Box $box -UserEmail Ownerofthefiles@company.com -DestinationList $dstList -DestinationFolder "FromBox"
Comments
0 comments
Please sign in to leave a comment.