Summary
Impersonation allows a site admin access to all the folders on the platform, including those that belong to other users. With SkySync, a job can be setup using the username and password of the site admin to sync / migrate / copy files to or from a different user's account without ever having the username or password of that user.
Scenario
In this scenario, files are being copied from an NFS location to the OneDrive for Business account of Joe Developer by the site administrator
- Create an NFS connection to be used as the source
{ "name": "\\\\srv\\users", "platform": { "id": "nfs" }, "auth": { "unc": "\\\\localhost\\d$\\dev\\Test\\Users" } }
Create a OneDrive for Business connection as the site administrator to be used as the destination
Create a new transfer job with the impersonate_as section in the body
{ "name":"My Impersonation Job", "kind": "transfer", "transfer": { "audit_level": "trace", "transfer_type": "copy", "source": { "connection": { "id": "{{nfs_connection}}" } }, "destination": { "connection": { "id": "{{cloud_connection}}" }, "impersonate_as": { "id": "12", "name": "Joe Developer", "email": "jdeveloper@domainName.onmicrosoft.com" }, "target": { "path": "/Documents/{{New_Folder_Name}}" } } }, "schedule": { "mode": "manual" } }
For platforms which use Active Directory accounts (such as SharePoint on-premise), specify the following instead of "email" in the "impersonate_as" block:
"username": "domain\user"
- Run the transfer job and notice that the source files have been copied to Joe Developer's OneDrive for Business account into the specified path.
PATCH {{url}}v1/jobs/{{job}}?start=1