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 structure so it all shows in the same place - is there a way to map this for all users to see as the log in normally? 

Hope that makes sense

thank you in advance.

Stef

  • 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


  • SvenSieverding's avatar
    SvenSieverding
    Bronze Contributor

    StefBon 

    You could copy the url of the folder in your Onedrive and then create a link to that url in your folder structure

     

    Then you will have a file that is linking to a folder on your Onedrive.

     

    But you should not work that way.
    Your personal Onedrive is meant for your own personal files and not to be used as a permanetly shared drive with your coworkers. (For example will your Onedrive be deleted if you ever leave your company and that would include all the files you shared with your coworkers).

    A better way is to create a folder structure in your company SharePoint and move all the files to be shared there.  Then you can use the "Add Shortcut to Onedrive" Feature to link that folder into your back own personal Onedrive.

     

    • StefBon's avatar
      StefBon
      Copper Contributor

      SvenSieverding hi Sven. Thank you for your comments. Very helpful. Just to elaborate. The reason for this is because a program we are running maps to OneDrive. But with limitations. It doesn’t allow us to map to our existing company SharePoint structure. So we’ve had to create its own SharePoint login. And the software has created its file structure within that login. So now we need all our users to be able to see that new software file structure. So my thinking was to share the folder to our company group and create a link in our existing folder so everything is visible in one place. So the link I create as you have mentioned needs to be something I can implement company wide ? I am not sharing my personal OneDrive at all. It is only the new software login which remains company property. Many thanks again. 

      • SvenSieverding's avatar
        SvenSieverding
        Bronze Contributor

        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