Forum Discussion

StefBon's avatar
StefBon
Copper Contributor
Nov 10, 2022
Solved

how to map private business onedrive to view within sharepoint folder

hi, i would like to show and give access companywide to my personal work sharepoint folder, however i would like to be able to then map this said folder within our existing sharepoint company file s...
  • SvenSieverding's avatar
    SvenSieverding
    Nov 11, 2022

    StefBon  Mhm.....
    Well, the link is just a link to a folder on the Onedrive website. You will still need to share that folder with you entire company or they will get a "permission denied" error

    But in your case...

    Could you just directly synchronize the desired local folder in your SharePoint structure using the Onedrive client? (I mean by navigating to the folder in SharePoint and then pressing the "Synchronize" button). Then the maps would be directly synced into the structure without Onedrive as an extra waypoint.
    If that functionality is disabled by your IT-Department, you should go, talk to them and ask them for an exception, as this seems to be a valid usecase for that functionality.

    Or you could think about other synchrinization methods

    You could for example use PnP Powershell in a scheduled task to sync a local folder into a SharePoint folder

    $localUploadFolder="D:\work"
    
    $destinationSharePointSite="https://tenant.sharepoint.com/sites/filestructure"
    $destinationFolderSharePoint="SiteAssets/folder1/folder2"
    
    Connect-PnPOnline $destinationSharePointSite
    
    Get-ChildItem $localUploadFolder -Recurse | Foreach-Object {
        
        $relativePath= $_.FullName -replace [regex]::Escape($localUploadFolder), '' -replace "\\","/"
        $path = "$($destinationFolderSharePoint)$($relativePath)"
    
        if ($_.Attributes -ne "Directory") {
            Write-Host "Uploading $($_.FullName) to $($path)"
            Add-PnPFile -Path $_.FullName -Folder $path
        }
        else {
            Write-Host "Scanning Folder $($_.FullName)"
        }
    }


    Or there is the possibility to use the SharePoint Migration Tool in a scheduled task.
    https://learn.microsoft.com/en-us/sharepointmigration/introducing-the-sharepoint-migration-tool


Resources