Ultimate folder redirection for Onedrive, Teams and Sharepoint (2024)

Subscribe

This site uses Akismet to reduce spam. Learn how your comment data is processed.

64 Comments

Most Voted

Newest Oldest

Inline Feedbacks

View all comments

Ultimate folder redirection for Onedrive, Teams and Sharepoint (2)

4 years ago

Hi Jos,

A quick question. If I have users in multiple departments, can the script be used in a cumulative fashion?

IE, if I were to have a base all users script, but I had some users in finance, and some in HR, and a couple across both those functions, could I deploy the script to their security groups and have them syncing all of the libraries they need for their job, or would whichever script ran last over-write the previous scripts?

4

Reply

View Replies (1)

Ultimate folder redirection for Onedrive, Teams and Sharepoint (3)

Sjaak

4 years ago

Hi Jos, great script! We are testing it right now. But after the client reboots, the Library sync is gone. We have this with all the clients.
Can’t find why..

Any idea?

The personal Onedrive sync will be fine after reboot. It’s just the shared library sync.
And if a set the library sync manually (via sharepoiint itself), the sync stay after reboot.

2

Reply

View Replies (2)

Ultimate folder redirection for Onedrive, Teams and Sharepoint (4)

Jeff

3 years ago

Hey Jos,

Is there a way to stop the script from running? I’ve deleted it from Intune but on a test device the script is still looping and failing because the test user doesn’t have access to one of the libraries which I’ve defined.

My idea was to have one script with all of our shares and was hoping the script would loop through and add the libraries the users has permissions for and skip any which the user does not have access to.

Is this possible?

Thanks,

Jeff

1

Reply

Ultimate folder redirection for Onedrive, Teams and Sharepoint (5)

4 years ago

I Get from intune that the scripts is run, but noting on client.
When i go to c:\windows\temp and have a look at the log i can se there stands.

Running as system, Running in system Context, script shot be running in user context, we should auto impersonate?

1

Reply

Ultimate folder redirection for Onedrive, Teams and Sharepoint (6)

Redirecting anything to Onedrive for Business | Liebensraum

2 years ago

[…] Ultimate folder redirection […]

Reply

Ultimate folder redirection for Onedrive, Teams and Sharepoint (7)

Full HD

3 years ago

The impersonation no longer appears to work on 20H2 has anyone else experienced this?

If i turn off run as system the script works.

If i turn on run as system. The log appears in C:\Windows\Temp.. but never runs as each user at logon.

Is there an update / fix?

Thank you!

Reply

Ultimate folder redirection for Onedrive, Teams and Sharepoint (8)

G Wendt

3 years ago

Everything seems to work for m except for the impersonation part. I have to run it under an admin account or it doesn’t work.

Reply

Ultimate folder redirection for Onedrive, Teams and Sharepoint (9)

Wayne

3 years ago

Having some issues with duplication of libraries and a ‘AutoMapTestTeam’ library that I can’t seem to remove.

Is there a way to clear all previously sync’d libraries and start over?

Thanks – Great tool by the way.

Wayne

Reply

View Replies (1)

Ultimate folder redirection for Onedrive, Teams and Sharepoint (10)

SRasschaert

3 years ago

Please cancel all my comments, I made a typo 🙂

Reply

Ultimate folder redirection for Onedrive, Teams and Sharepoint (11)

SRasschaert

3 years ago

Hi

First of all, I want to thank you for this great script and your contribution to the community!

I wanted to let you know that I am running into an error.
I configured the list of Libraries as indicated in you manual, because I do not want to syn any libraries.
$listOfLibrariesToAutoMount = @()

However, I receive an error at the following line,

$targetPath = Join-Path -Path (Get-Item “$($Env:USERPROFILE)\$companyName\$compositeTitle”).FullName -ChildPath $redirection.targetPath

Error: Get-Item : Cannot find path ‘C:\Users\xxxxxx\%COMPANY%\ – ‘ because it does not exist.

Last edited 3 years ago by SRasschaert

Reply

Ultimate folder redirection for Onedrive, Teams and Sharepoint (12)

Iain

3 years ago

I’m seeing an issue in our environment when signing into a new Azure AD joined device where the script appears to run successfully, but the users folders are not redirected to OneDrive. I think the issue may be that we previosuly did folder redirection via a GPO when devices were Hybrid joined, meaning all the folders we want to redirect now via the script are already present in the users OneDrive. What would be a good solution for that?

Reply

View Replies (3)

Ultimate folder redirection for Onedrive, Teams and Sharepoint (13)

4 years ago

Hi.

Is it posibel to have the script to remove old folders?

i try to set up for some folders on one document libery, but know we have decided to make a hole new setup on a new document libery.

But in my test i have removede the older foldes but it dont remove it?

any good ideers?

Reply

View Replies (2)

Ultimate folder redirection for Onedrive, Teams and Sharepoint (14)

Jeff

4 years ago

Hi there,
I love the idea of this but I can’t seem to get it to work. I followed the steps and left the powershell script clean (other than the proper tenantID). It will log my test user in but it pops up a window of Microsoft OneDrive and it just says Loading forever. If I close it, it will re just reopen and never load anything. What I’m really trying to do is redirect the Video folder but that doesn’t seem to work either…help?

Reply

Ultimate folder redirection for Onedrive, Teams and Sharepoint (15)

PacketThrower

4 years ago

This script is fantastic, exactly what I needed! I have one question.. I have a client whom has over 18 sites, and some users may or may not have access to all. Currently I’ve added 2 sites, one ‘testuser’ has access to and another he doesn’t. it keeps on continuously generating the need to add in that site.. Is there a way to close that loop is that person doesn’t have permission? I’d rather not create 41 Posh scripts :).

Reply

View Replies (1)

Ultimate folder redirection for Onedrive, Teams and Sharepoint (16)

4 years ago

Hi. So great a script.
we just see some problems if a user dont have access to a sharepoint folder.
Then the scripts keeps going in a loop telling onedrive dont have access to the folder..
is there a fix for this?

Reply

View Replies (1)

Ultimate folder redirection for Onedrive, Teams and Sharepoint (17)

Tarik

4 years ago

Hi Jos,

Thanks for the script. I’m getting the following error, any ideas?

Sending ODOpen command…
start : This command cannot be run due to the error: Application not found.
At C:\Users\xxx\Desktop\Invoke-O4BAutoMount.ps1:642 char:17
+ … start “odopen://sync/?$($library.syncUrl)&userEmail=$([ur …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand

Reply

View Replies (1)

Ultimate folder redirection for Onedrive, Teams and Sharepoint (18)

Rene

4 years ago

Hallo Jos,

Is het ook mogelijk om Bovenaf dus in ons geval per school het te koppellen? nu zou ik elke bibliotheek los moeten doen wat een hoop werk is. zou het ook kunnen dat ik de school site toevoeg en dat ze daaronder dan alle bibliotheken ziet?

ik kan dat wel doen met de Onedrivemapper zodat ik alleen de school site hoefde in te geven en dat ze op basis van rechten de onderliggende bibliotheken zagen.

Reply

View Replies (8)

Ultimate folder redirection for Onedrive, Teams and Sharepoint (19)

Andrew Taylor

4 years ago

Great script! What happens if a user has redirected app data and then rebuild the computer? Will it overwrite the previous app data with the new blank one from the rebuild? I’d like to protect signatures, auto text etc. Would it be safer to just not copy existing files?
Thanks

Reply

View Replies (2)

Ultimate folder redirection for Onedrive, Teams and Sharepoint (20)

Rene

4 years ago

Heey Jos,

Misschien is een mogelijkheid om aan het script toe te voegen dat de offline bestanden na een tijdje verwijderd worden lokaal. wat de functie opruimen doet van onedrive. er is ook zoon functie in windows maar ik heb nog niet kunnen vinden om dit voor alle computers/users door te voeren dat hij bijvoorbeeld na 3 dagen de offline bestanden opruimd en omzet naar alleen online bestanden.

Reply

View Replies (2)

Ultimate folder redirection for Onedrive, Teams and Sharepoint (21)

Collin

4 years ago

Hi Jos, great script, thanks for that! I have one ‘issue’ which you might be able to help solve. We have a Team and there are several files and folders in the document library of that Team. When I connect Onedrive using your script, I see all my files and folders INSIDE a folder called ‘General’. Our users than have to open that folder ‘General’ and they will find all files and folders that are also visible via the Teams app. But when they make other folder at the same level of the General folder, no one will be ableRead more »

Reply

View Replies (2)

Ultimate folder redirection for Onedrive, Teams and Sharepoint (22)

Raj

4 years ago

Hi,
Just noticed something strange when running the script, I get “OneDrive not yet fully configured for this user….”
Checking the script there is the line
if($account.GetValue(“Business”)
However checking the registry on my system I have Accounts\Business1 so the test fails and the script fails.

Will see if I can fix and post back.

Thanks

Raj

Reply

View Replies (1)

Ultimate folder redirection for Onedrive, Teams and Sharepoint (23)

4 years ago

If i wanted to map multiply folders, it only maps on.

$listOfLibrariesToAutoMount = @(
@{“siteTitle” = “Alle”;”listTitle”=””;”syncUrl” = “tenant…”}
@{“siteTitle” = “Oekonomi”;”listTitle”=””;”syncUrl” = “tenant…”}
@{“siteTitle” = “Personale”;”listTitle”=””;”syncUrl” = “tenant…”}
)
am i doing something wrong?

Also, i get notifiet all the time that the foldes is allready in sync.
it pops up with 2 min between

Reply

View Replies (6)

Ultimate folder redirection for Onedrive, Teams and Sharepoint (24)

Michael

4 years ago

Hi Jos,

Create artikel! It is definitely what i was looking for!

If you declare a space within the siteTitle of $listOfLibrariesToAutoMount it gets recplace for a + sign by [System.Web.HttpUtility]::UrlEncode.

If you use [uri]::EscapeDataString it will change to %20 so people see a normall space wihtin explorer.

Is there a particular reason why you use [System.Web.HttpUtility]::UrlEncode?

But again create script! Will proberly use it alot

Reply

View Replies (1)

Ultimate folder redirection for Onedrive, Teams and Sharepoint (25)

Sasaus

4 years ago

Thanks for this. Is it possible to have the name be the same as when you hit the Sync button?

For example a document library named Apps in a SharePoint site named Files gets the name Files – Apps when synced manually through the button.

With your script it gets the name Apps – Documents.

I use applications that get certain data from synced SharePoint sites, but I cannot set multiple possible paths to the folder location.

Reply

View Replies (1)

Ultimate folder redirection for Onedrive, Teams and Sharepoint (26)

Testy

4 years ago

How would this work on a shared computer?

Reply

View Replies (2)

Ultimate folder redirection for Onedrive, Teams and Sharepoint (27)

Roaming Chrome settings with Intune MDM | Liebensraum

4 years ago

[…] As you may have noticed, I’m using an environment variable here called ${DOCUMENTS}. This variable is a google-specific variable, you can’t use environment variables here like %APPDATA%, if you want to roam to a different location, use my Ultimate redirection script […]

Reply

Ultimate folder redirection for Onedrive, Teams and Sharepoint (28)

O4BClientAutoConfig | Liebensraum

4 years ago

[…] ARTICLE SUPERCEDED BY Ultimate folder redirection for Onedrive, Teams and Sharepoint […]

Reply

Ultimate folder redirection for Onedrive, Teams and Sharepoint (2024)

FAQs

How SharePoint and OneDrive interact with Microsoft Teams? ›

Team members can open the file right in Teams and start making changes or commenting. If a team member stores a file in OneDrive, it can also be added to the Teams channel by using the Files tab in Teams. Best of all, you can go mobile with Teams, so your project members can work from anywhere.

How do I link OneDrive folder to SharePoint? ›

For the OneDrive folder, please select it, click the three points, Details, under More details, you should see its Path field, click the button beside Paht to copy its direct link. 2. Create a link on the SharePoint site and paste the URL. In the library, you can click the New button, select Link, then paste the URL.

Can you link a OneDrive folder to Teams? ›

Meanwhile, if you want to transfer your content to the Teams' file tab. Go to your OneDrive. Click on the folder which you would like to move to Teams > Copy to > Select the target team and click OK. Hope this information helps.

What is folder redirection in OneDrive? ›

Users interact with files in the redirected folder as if it still existed on the local drive. For example, you can redirect the Documents folder, which is usually stored on a local drive, to a network location. The files in the folder are then available to the user from any computer on the network.

How do I sync files between SharePoint and OneDrive? ›

In your browser, on your SharePoint site, navigate to the library of files you want to sync with. Select Sync in the toolbar. Note: If your browser asks for permission to use OneDrive, confirm that it's OK. Sign in to OneDrive to start syncing your files and finish OneDrive setup.

Does Teams automatically sync with SharePoint? ›

Each team has a corresponding SharePoint site. Changes made to files in SharePoint automatically sync to Teams (and vice versa), but if you want to make sure you have the very latest version of a file, you can manually sync the file libraries.

What is the link between SharePoint and OneDrive? ›

OneDrive is the files experience for Microsoft 365 and SharePoint Server*, giving you access to all your work or school files, including the files that people share with you directly or through the teams you're working on.

How do I navigate to SharePoint from OneDrive? ›

See your SharePoint or Microsoft Teams files in the OneDrive mobile app
  1. In the OneDrive app when signed in with your work or school account, select Libraries.
  2. Select the name of the site and then the library where the files are located.

How do I give access to OneDrive in SharePoint? ›

Go to Sharing in the SharePoint admin center, and sign in with an account that has admin permissions for your organization. Under External sharing, specify your sharing level for SharePoint and OneDrive. The default level for both is Anyone.

Is OneDrive connected to MS Teams by default? ›

Note: The OneDrive files you see in Teams are OneDrive for Business files associated with your Microsoft 365 account, not your personal OneDrive. Teams can't currently connect to your personal OneDrive. Files you upload to a channel are stored in your team's SharePoint folder.

Why is my OneDrive not syncing with Teams? ›

If OneDrive was turned on – restart it. Check for any sync failures. Ensure that you are correctly logged in. Try signing out of Teams, rebooting your machine, and signing back into Teams.

How do I move files from OneDrive to Teams? ›

Move or copy files
  1. In Teams, select OneDrive > My files.
  2. Find the file you want to move or copy. Note: If the file is in My files, hover over the file and select More options. ...
  3. Hover over the file and select More options > Move to or Copy to . ...
  4. Select the folder you want to move or copy the file(s) to.
  5. Select Move here.

What is the best practice for Folder Redirection? ›

For optimal performance of the Folder Redirection feature, it is strongly recommended that you create only the root share on the server, and then let the system create the folders for each user. If you must create the folders for users, ensure that you correctly assign permissions.

Is Folder Redirection a good idea why or why not? ›

Folder Redirection allows saving data regardless of storage location and separates user data from profile data decreasing the time required to log on. Other advantages include: Data is stored on a server where it can be backed up.

How to configure Folder Redirection? ›

Configure Folder Redirection settings under User Configuration > Policies > Windows Settings > Folder Redirection. Specify the target folder that we want to redirect to the network location. In this demonstration, the document folder is selected to redirect to the E drive on the server.

How does Microsoft Teams integration with SharePoint? ›

Teams and SharePoint

When you create a new Team, it automatically creates a corresponding SharePoint site that's linked to the Team. You can use SharePoint to store and manage files related to your Team's work, and you can share those files directly in Teams.

What's the difference between SharePoint and OneDrive and Teams? ›

SharePoint - shared file storage, communication, data management for working with other people. OneDrive - personal file storage that can also be used to sync SharePoint files for your access. Teams - Collaboration/communication/chat/meetings layer that uses SharePoint and OneDrive for storage.

Does OneDrive automatically sync with Teams? ›

After you set up syncing, the files sync automatically.) If your browser requests permission to use "Microsoft OneDrive," confirm that this is okay.

How do I protect files in SharePoint OneDrive and Microsoft Teams? ›

Sign in to the security center's safe attachments configuration page. Select Global settings. Ensure that Turn on Defender for Office 365 for SharePoint, OneDrive, and Microsoft Teams is set to on. Select Save.

References

Top Articles
Latest Posts
Recommended Articles
Article information

Author: Kimberely Baumbach CPA

Last Updated:

Views: 6344

Rating: 4 / 5 (61 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Kimberely Baumbach CPA

Birthday: 1996-01-14

Address: 8381 Boyce Course, Imeldachester, ND 74681

Phone: +3571286597580

Job: Product Banking Analyst

Hobby: Cosplaying, Inline skating, Amateur radio, Baton twirling, Mountaineering, Flying, Archery

Introduction: My name is Kimberely Baumbach CPA, I am a gorgeous, bright, charming, encouraging, zealous, lively, good person who loves writing and wants to share my knowledge and understanding with you.