![]() $departingOneDrivePath = "/personal/$departingUserUnderscore/Documents" Any help would be great thanks! # Define relative folder locations for OneDrive source and destination I tried modifying the lines below to try to get the /Documents/ to be seen but the error logs keep showing the next section. Write-Host "`nComplete!" -ForegroundColor Green Set-SPOUser -Site $destinationOneDriveSite -LoginName $globaladmin -IsSiteCollectionAdmin $false Set-SPOUser -Site $departingOneDriveSite -LoginName $globaladmin -IsSiteCollectionAdmin $false Write-Host "`nRemoving $globaladmin from OneDrive site collections" -ForegroundColor Blue # Remove Global Admin from Site Collection Admin role for both users $fileerrors | Out-File c:\temp\fileerrors.txt $newfile = Copy-PnPFile -SourceUrl $ -TargetUrl $destpath -OverwriteIfAlreadyExists -Force -ErrorVariable errors -ErrorAction Silentl圜ontinue Write-Host "Copying $($) to $destpath" -ForegroundColor Green $destpath = ("$destinationOneDrivePath$($)").Replace($departingOneDrivePath, "") $InitialDomain = Get-MsolDomain | Where-Object $credentials = Get-Credential -Credential $globaladminĬonnect-MsolService -Credential $credentials $globaladmin = Read-Host "Enter the username of your Global Admin account" $destinationuser = Read-Host "Enter destination user's email" Script: $departinguser = Read-Host "Enter departing user's email" The only issue I am having is the items in the root directory fail to copy and I am unclear on why. If anything is in the root directory, it does not get copied over and I get an error stating Null value for source item in the output in C:\temp\fileerrors.txtĮdit: I did not clarify before, all items in folders in the Departed OneDrive and the folder itself will be copied over. This script almost does what I need it to do but I keep hitting one snag. I am attempting to use a script I saw to assist with moving files over from one users OneDrive to another. Research Triangle Powershell User Group remote-capable. ![]() Philadelphia PowerShell User Group remote-capable.Madison Power Users Group remote-capable.Denver Microsoft Enterprise Management User Group.NET, POSH is a full-featured task automation framework for distributed Microsoft platforms and solutions. Windows PowerShell (POSH) is a command-line shell and associated scripting language created by Microsoft. Submission Guidelines | Link Flair - How To ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |