OneDriveMapper

onedrivemapperOneDriveMapper is a free script you can use as a logon or on demand script to map a OneDrive for Business location and/or Sharepoint locations to driveletters, it has been downloaded over 90000 times and is also listed on Technet.

It was designed to run in scenario’s where using the Onedrive for Business client is not feasible, such as multi-user environments like Citrix or within a RemoteApp. Syncing in such environments is a bad idea as each user potentially has to re-sync data at each login and can potentially access other user’s data.

What does it do?

  • Runs at logon or on demand (group policy, RES, etc)
  • Maps your OneDrive for Business to a local driveletter
  • No Sync, online WebDav connection
  • Connects seamlessly without user interaction
  • Prompts for user password (only once) if no ADFS used
  • On Demand Provisioning of the OneDrive MySite
  • Detailed and configurable logging
  • Also maps Sharepoint Document libraries directly
  • Can also map based on security groups
  • Automatically disables and reenables ProtectedMode in IE
  • Sets a customizeable label for the Network drive(s)
  • Can use custom library names
  • Can also run on non domain joined machines or Workplace Joined machines
  • Detects changed user names/url’s automatically
  • Can map drives inside (Azure) RemoteApps
  • Can redirect My Documents to Onedrive for Business
  • SSO for MDM Intune AzureAD W10 devices
  • Can be deployed as logon script through Intune
  • Can easily run from a shortcut as well

Requirements

  • Office 365 licence
  • Office 2010 or higher installed if not using Native Auth
  • Permission to map drives
  • Permission to launch powershell scripts

Recommendations

How to install

OneDriveMapper_v3.08.ps1 (right click, save as)

OnedriveMapper Cloud

Older versions: v2.52,v2.49v2_45v2.38

  1. Add https://tenantname-my.sharepoint.com to your Trusted Sites list if mapping to O4B
  2. Add https://tenantname.sharepoint.com to your Trusted Sites list if you’re mapping to Sharepoint Sites
  3. Add adfs.yourdomain.com to your local intranet sites (both http and https) to get SSO if you’re using ADFS (or Okta). Make sure that whatever method you use to set this, runs BEFORE the script runs.
  4. Ensure Windows Authentication is enabled in Internet Explorer (this is default) if not using Native Auth
  5. Configure the script, set $domain to your Office 365 UPN suffix
  6. Set $driveletter to the driveletter you wish to map to OneDrive for Business and are not using the Cloud Edition
  7. set $O365CustomerName to whatever you used to sign up to Office 365 (xxx.onmicrosoft.com)
  8. If you wish to map Sharepoint libraries, change line 114 of the script ($sharepointMappings += XXX) if you’re not using the Cloud Edition
  9. disable file locking
  10. Run it on a representative test machine / user and thoroughly check the log it generates in %APPDATA%
  11. Add the configured script to a Group Policy or deploy as MSI to make it run upon logon for all users, automatically mapping your OneDrive for Business webdav share to a driveletter.

Limitations

  • When using native auth mode, MFA support is still pending
  • When using native auth mode, Okta is not supported (until okta helps me out)
  • if you use redirection and restartExplorer true, make sure the script runs when the user is fully logged in, restarting explorer during logon can cause hangs. Best practise: don’t enable it, the redirect will work the next logon for roaming profiles
  • Native authentication mode does not work Powershell V2 or lower (comes with Windows 7)

Disclaimer

I am by no means a real programmer, use this free script at your own risk, I provide no warranty whatsoever. I try to answer questions here as quick as I can, but I can’t provide dedicated support. Note that although it is unexpected, if Microsoft at some point decides to block WebDav connections to OneDrive for Business, this script may suddenly become obsolete without prior warning. If Microsoft drastically changes login.onmicrosoft.com, the script may also stop working until I can release an update.

Changelog

FAQ

 

 

Leave a Reply

1346 Comments on "OneDriveMapper"

Notify of
avatar
Sort by:   newest | oldest | most voted
trackback

[…] OneDriveMapper […]

Tom
Guest

Hi Jos

The script is working perfectly for us, however if a user opens an Office file from the mapped drive and they haven’t signed in to Office 2016 they are prompted for their password. Strangely though if they close the prompt then the file does open.

From what I have read this is due to how Office works with WebDAV, but wanted to see if other people are having the same problem.

Thanks

Luke
Guest

Hi Jos, this script is amazing and I love it, however I regularly get an error “>AADSTS165000: Invalid Request: The request tokens do not match the user context.” which causes fallback mode.
That’s not a big problem, except that once signin in fallback mode is successful, a modal appears underneath every other open window titled “Are you sure you want to leave this page?” with “Message from webpage: null” and two buttons to either “Leave this page” or “Stay on this page.”

Is anybody else getting this?

Peter H
Guest

We’re getting this also. Strangely though it doesn’t occur on all our Terminal Servers and also not with all user accounts. It can be a little bit hit and miss to be fair. I’m so glad that someone else is getting this though as I’ve been pulling my hair out for the passed week…

Aart
Guest

Yes, if using version 2.53 this error appears last few days. Tomorrow I tried using version 3.06 and then all is working well without this window.

Kevin De Schrijver
Guest

Has anyone found a solution for the slow upload speeds towards OneDrive/Sharepoint using Windows Explorer? Already deactivated the “Automaticlly detect settings” in IE but still getting abysmall upload speeds

Sam
Guest
Hi Jos, OneDrive mapped has stopped mapping OneDrive this morning for all our users, still maps the additional Sharepoint sites, just not the OneDrive, error below; Mapping target: \{domain}-my.sharepoint.com@SSLDavWWWRootpersonal{user_domain}Documents ERROR: detected string error 224 in return code of net use command, this usually means your trusted sites are misconfigured or KB2846960 is missing failed to contact H: after mapping it to \{domain}-my.sharepoint.com@SSLDavWWWRootpersonal{user_domain}Documents , check if the URL is valid. Error: Access Denied. Before opening files in this location, you must first add the web site to your trusted sites list, browse to the web site, and select the option to… Read more »
Jason
Guest

I also have the same issue.

I try to remove all sharepoint site link, just map the personal onedrive, it was working fine.

Kevin De Schrijver
Guest

Feature request: Great script. I have hidden the powershell window but at the moment the statusbar “Mapping your Office 365 Drives” is persistent and cannot be minimized during the mapping stage.

Could you make it minimizeable so that users have the choice to wait for their drives to connect or open another application and start working without the statusbar stuck in their face.

trackback

[…] OneDriveMapper […]

Márton Bacsó
Guest

Dear Jos,

I have just upgraded the script from 2.38 to 2.43. Now it only works when I set “userLookupMode” to 4 and it still asks for my e-mail address in a pop-up window, although I have saved both my username and password into the script. 2.41 from TechNet gives me the same error message:

“A username was already specified in the script configuration: bacsom@thankaroly.hu
userLookupMode is set to 1 -> checking Active Directory UPN
Failed to lookup username, active directory connection failed, please change userLookupMode”

Your help would be greatly appriciated!

Trond
Guest

Jos, suddenly one computer got the error “userLookupMode is set to 3, but we failed to detect a proper username” in the log. While manually doing the lookup for SID and, username and SAM, everything seems normal, also the registry keys are in place.
Here are the contents from HKLM Reg key: (Added a bunc of X’es)
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IdentityStore\Cache\S-1-12-1-2648678820-1127942705-2445130163-XXXXXXXXXXXX\IdentityCache\S-1-12-1-2648678820-1127942705-2445130163-XXXXXXXXXXXXXXXX]
“UserName”=”guxxxxxxxx@xxxxxxxxxxxxxkk.no”
“SAMName”=”XXXXXguXXXX”
“DisplayName”=”guxxxxxxxx@xxxxxxxxxxxxxkk.no”
“ProviderName”=”XXXXXX”
“ProviderGUID”=”{XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXXXX}”
Also, while debugging, I tried to set username in the file, but that logic is not honored any more. It stills try to use the UserLookupMode.
Delete that whole section: “switch($userLookupMode)”
and where able to use username.
Do you have any clue what could be wrong?

trackback

[…] OneDriveMapper […]

Usmaan
Guest

Hi Jos,
further to the previous post, Im using User lookup mode 6 .
Also, there’s no log file created in the %APPDATA% folder, so i suspect that it’s not executing

Usmaan
Guest

Hi Jos,

I’m using the OneDriveMapper cloud config using the MSI.
When I run the MSI using the ID created online, i get a warning message box stating “The specified account already exists”

I’ve tested the online configuration using the .PS1 file and that works, so it must be something with the way I’m running it my Windows 10 Pro machine

Rogier
Guest

Hi Jos we have some issues with the first authentication method.. seems like adfs in the logs.. were looking into this… but the strange thing is that the user gets to see a powershell window this is when it tries to fallback on alternative login methods.. is it possible that we can hide this 2nd script?

Larry
Guest

Great script and a VERY useful resource. Thank you for creating this.

Have you noticed issues if the environment has IE under GPO control already?

MPA
Guest

Hi Jos,

I’m not sure what i’m missing, but i’m having a hard time mapping OneDrive for Business with your script. We are using Okta for MFA. Any help would be appreciated.

Thanks

Andrew Heys
Guest

We are having the issue below

06/20/2017 11:54:20 | INFO | configurationID set to IdNumber, retrieving associated settings from lieben.nu…
06/20/2017 11:54:24 | ERROR | failed to retrieve settings from lieben.nu using D601F6AF-D8DF-91B6-029A-3FB2A40E39A6 because of Exception calling
“GetResponse” with “0” argument(s): “The remote server returned an error: (407) Proxy Authentication Required.”, content of request:

Winson
Guest

Hi Jos,

I would like to map the SharePoint only using the OneDrive Mapper. Could you please kindly advise how I can disable the mapping of the personal OneDrive for Business? Thanks!

Luke
Guest

Hi Jos,

We really like the script. However we want to roll it out to the business. Do you have a supported paid version? (autoupdates) or know of any good paid versions?

Thanks

Darko
Guest
Hello Jos, I’m just testing your OneDriveMapper v.3.08. Great work, thank you. Altough it works without any problems in interactive mode (when user is logged in or at least locked) I found that it can’t run if it is started via WindowsTask and user is not logged in. In this case I got a log events like this: 06/10/2017 22:25:12 |INFO | —–06/10/2017 22:25:12 OneDriveMapper v3.08 – dare on EXTRA12 starting—– 06/10/2017 22:25:12 | ERROR | Script elevation level: Administrator 06/10/2017 22:25:13 | INFO | Scheduled a task to run OnedriveMapper unelevated because this script cannot run elevated 06/10/2017 22:25:13… Read more »
Rudolf
Guest

Hello Jos,
I really like your script!
One addition would be nice. When a scheduled task is created, the -NoProfile option should be included. I get a popup to login to my O365 sessions every time the script runs, which is pretty annoying. I added it myself, but I think it should be standard.

For the rest: keep up the good work!

Mark
Guest

For some reason my mappings dissappears during the weekend. We’ve installed OneDriveMapper on our Citrix farm, and it works for a week, then it pops up and tells the user to log back on and check trusted sites. Anyone else experiencing this? Does this only happen if trusted sites is misconfigured (which it isnt) ?

Joe
Guest

My users have been getting prompts in Citrix too as of a couple days ago. It also looks like our Azure AD Connect SSO stopped working in general. Still investigating if they corelate.

Henk Schouten
Guest

We have the following situation: our students log in with a mandatory profile based on the location of the PC. I have depolyed the script with a GPO. The first time they log on to a machine the driveletter is not deployed. when the log off and on again the drive letter is deployed and ready for use. The GPO is the second one in row. The first one give connection to internet via a Smoothwall proxy.

Can you tell me what to do so that our students will be connect to OneDrive the first time they log on?

Mike Davies
Guest
Hi Jos, Great script – especially the new native auth which is making a big difference in terms of drive connection speed for people on machines they’ve not used before (i.e. cookie not already present). In testing I have found that your script can still take extended periods of time depending on client configuration and I wondered if you had any thoughts on how I could speed it up? 1) If the client PC has a number of drives mapped, but some are in disconnected state, the WMI call in checkIfLetterIsMapped can take over 30 seconds. I get round this… Read more »
Leah
Guest

Hi Jos / all, we’ve tried this as a solution for our VDI environment, but because our users are accessing VDI from home while still logged in at work, we’re getting a second $RECYCLE.BIN created in each of the redirected folders, which is in turn giving a message in the OneDrive NGSC: “You now have two copies of a file”. On subsequent logons to VDI it creates additional $RECYCLE.BINs too. Has anyone seen this and/or found a solution please? Thanks in advance.

Joan
Guest

Hi!
You are doing a great job with this script! We are expecting the future cloud version 😉

We are implementing the script and it’s working very well inside our organization (With AzureSSO)…
But laptop users, when are out of office (at home, for example), the script fails….

What is the correct way to do the native auth and if a user is not in the company, prompt for their username/password?

thanks!

Marcel
Guest

Great Script! In my environment we have users with different UPNs. Could the script be modifed that it gets the UPN suffix from the currently logged on user and use that as the $domain variable?
Could use something like :
(get-aduser ($Env:USERNAME)).userprincipalname
And the split the result on “@” and use part [1]
I am not sure where to implement this in the script. Additional function? Anyway thanks!

Phil Warren
Guest

We have been using this script for 3 months now and everything is working perfectly. One thing we have noticed is that the mapped drive is very laggy sometimes when copying and moving files and folders. is there something i need to look at to improve the performance of the mapped drive.

trackback

[…] and the shared area on the other tenancy to drive letters. We use the OneDriveMapper script (OneDriveMapper | Liebensraum), but as soon as we introduce the shared area into the script, it becomes flakey – it works, […]

Ruben
Guest

Hi Jos,
We recently set up ADFS. When we run the script we get an “Error received from ADFS server: Exception calling “GetResponse” with “0” argument(s): “The remote server returned an error: (401) Unauthorized.” when using the native Federated authentication. Any suggestions on how we could troubleshoot this would be greatly appreciated.
Thank you

Bobby Lansing
Guest
Hey Jos, I love the script and really appreciate your hard work. Without this script, my company could not have adopted SharePoint the way we have and I think it is awesome. One question, I have been having issues recently with the v3.07 where the user will try to access the drive after logging in and will be denied with the common “Access Denied. Before opening files in this location…” error. But the previous versions worked great, so I am wondering if the new ‘native’ method has caused you or anyone else issues like this and if there is a… Read more »
Daniel S
Guest

Hi,

Thank’s for the script, this would be really helpful.

It is erroring for me;

05/25/2017 12:36:21 | INFO | Logged into Office 365!
05/25/2017 12:36:22 | INFO | Retrieving Onedrive for Business cookie step 1…
05/25/2017 12:36:26 | ERROR | Failed to retrieve cookie for Onedrive for Business: Exception calling “Create” with “1” argument(s): “Invalid URI: The hostname could not be parsed.”
05/25/2017 12:36:26 | ERROR | Problem reported during step 2: no request given
05/25/2017 12:36:26 | INFO | Waited for 0 seconds for O4b auto provisioning…

Any ideas?

Peter H
Guest

Hi Jos. Probably something very simple; each time I run a new version of the mapper, I get the message pop-up above the taskbar that there a is a ‘newer version available’ despite me running the latest version. Is there anywhere in the registry that I can address this? Thanks as always…

Shane
Guest

Hi Jos,

Is there a way to map drives with spaces in the URL?

A recently created site has the URL:
/Gedeelde documenten/

instead of Documenten

OneDriveMapper can’t seem to map the drive because of the double space in the URL.

Dave
Guest
Hi Jos, First of all thank you for this wonderful script. I would like to use it in a lab environment but I am having a few issues. I am using version 3.07. Firstly, anytime someone opens an Office document, they are prompted specifically by Office saying “which email do you want accessing this file?” I have tried KB943280 , but to no avail. Secondly, I get random access denied errors when I try an open other files such as zip folders. Not all files. Just some files. It seems that larger files are mainly the culprits. If you have… Read more »
trackback

[…] OneDriveMapper […]

Don
Guest

Jos
Thanks for the script. We are using the latest 3.07 script and works great for most our users and fixed an issue with our Windows 10 users. But have a few boxes getting this despite the URLs appearing correct. “failed to contact O: after mapping it to \namexxxx-my.sharepoint.com@SSLDavWWWRootpersonalusernameDocuments, check if the URL is valid. Error:
System error 53 has occurred.
The network path was not found.

On a different computer that user works fine so appears to be a box issue. Any suggestions ?

trackback

[…] I love it when I find the solution to my own problem. Early days but playing with this script appears to do the job OneDriveMapper | Liebensraum […]

Scott
Guest

Does OneDriveMapper support using ADFS 2.0 using forms authentication? I am getting errors where the script cannot find the username

Nigel
Guest

I’ve deployed to a few test users in my small office but they are getting “Could not connect to your corporate network” after prompting for login.

They are Windows 7 with WMF 3.0 installed. Any suggestions? I am deploying using the MSI from the cloud option of Mapper.

Nigel Brown
Guest

Does the client running the mapper script – say deployed via intune / msi – need windows management framework of any level? I am targeting Win7 Pro devices currently.

Don B
Guest
We use the ADFS to login (which this scripts supports) but some of our users also have to enter a code from the Azure Auth App. I know the script does not support MFA but for us it looks like the code screen is nothing more complex than the parsing of the pages leading up to it – is there a reason your script does not support this? I’m curious rather than ‘needy’, if there is no other obstacle to this working that adding an additional step into the script then I’ll have a go at adding it – if… Read more »
Andrew
Guest

Hi Jos
Some of our users are getting a black screen at log in. The mouse is visible and moveable, but other wise the desktop is inaccessible. We do (or did) have restart IE specified as TRUE. Is the black screen the symptom of the “hang” you describe in the notes above?

Mike A.
Guest
Hi Jos. Thanks for this great script. We’re having an issue with the new 1703 build of Windows 10 (Creators). When the script runs, it hangs at “Loading CookieSetter…”. After a few minutes it errors out with: ERROR: Failed to set test cookie, script will fail: Exception calling “SetWinINETCookieString” with “3” argument(s): “Exception setting cookie: Win32 Error code=-1906440333” This is happening with all user accounts. I had no issues with the previous build of Windows 10. Any thoughts on how to troubleshoot? This is a clean image with brand new user profiles. Running v3.07 Thanks. – Mike
Rogier
Guest

Hi Jos, thank you for the script this works much better than a script we had from another supplier.
We do have issues with opening Adobe PDF files, in which the user gets a MS o365 login page.
Is this known issue?
I already have our companyname-my.sharepoint.com etc in the trusted sites.

Mark
Guest

Great script! All mappings work but the Label takes the Folder name from SharePoint and not the one I defined in the script. The behavior is the same for both the personal OneDrive and the two sites drives I have defined. $drivelabel is set to “OneDrive”. And the commas are set as described for two others. The drive letters come out correct but not the labels.

trackback

[…] OneDriveMapper […]

Blu3s
Guest

Hi Jos,
trying to use the tool, initially looks good, but after a while i get “INFO | Attempting to detect username at https://eur.delve.office.com/?u=1fd485e8-9d9b-4fff-98b0-e9b0bfe4066f&v=work, waited for…” until

Blu3s
Guest

until the message became “ERROR | Failed to get the username from the URL for over 62 seconds while at https://eur.delve.office.com/?u=1fd485e8-9d
9b-4fff-98b0-e9b0bfe4066f&v=work, aborting”

Mickael Selander
Guest
Hi, We just love your script but have started experiencing the error stated earlier on the latest version, I think there may been a Microsoft update on win7 System error 224 has occurred. Access Denied. Before opening files in this location, you must first add the web site to your trusted sites list, browse to the web site, and select the option to login automatically Just some machine have started getting this, that worked yesterday. We can successfully logon using internet explorer but the Onedrivemapper stops at 50% and waits there for multiple seconds and then it just exists, no… Read more »
Mickael Selander
Guest

Seems to me something regarding cookies on Windows 7, like it can’t find the authentication cookies?

Chris
Guest
Hi, Thanks for creating this it looks great and is just what I need in my organisation and we have a very simple sharepoint implementation via office 365. But I have not been able to get it working and I guess it is just my own ignorance which is stopping me 🙁 I simply want to be able to map sharepoint document libraries – nothing else. Is there anyone who can help me through this and check my settings? Im not familiar with powershell. Be great if there was but otherwise I will keep plodding on. At the moment I… Read more »
Kevin
Guest
I’m having an issue with OD4B drive mappings. In this case, While SharePoint drives map successfully, OD4B drives do not, and it appears it is because the domain name differs between the two. The domain in question is in the form xxxxxxxxxxxxxxxcenter.org (obfuscated, but correct number of characters). Sharepoint drives map fine to \xxxxxxxxxxxxxxxcent.sharepoint.com@SSLDavWWWRootShared Documents (note the missing trailing er in the domain name). However, OneDriveMapper is throwing errors trying to map the OD4B drive to https://xxxxxxxxxxxxxxxcenter-my.sharepoint.com/_forms/default.aspx (note the existence of the trailing er in the domain name). Not sure why they are traying to map to different domain names,… Read more »
Kevin
Guest

(sorry for the typos above). The domain name definitely has the trailing er characters. Does MS chop down domain names to <20 characters before appending sharepoint.com or -my.sharepoint.com?

Joe
Guest

Hi Joe,
Thanks for the fab article and code!
I cannot find how I disable Webdav File Locking anywhere or am I missing something simple?
Joe

Jeremiah
Guest

Hey Jos, Great script. Appreciate the effort that you’ve put into it. I’m still getting random failures using v3.06, both Windows 7 and Windows 10, all different builds. I’d say probably 99% of the time it’s logged as System error 224. We have all of the sites located in local user’s trusted sites as the log file indicates that they’re found. We’re using Native Mode. We’re only mapping O4B and no other SharePoint document libraries. Any assistance you can provide would be helpful. Thank you.

Luiz Eduardo F
Guest
Hi there, Jos! Found this marvelous script this week and after a bit of headbutting, was able to make it work. Don’t worry, it wasn’t your fault. I have two questions for you. First, when I try to overwrite a folder/file with a folder/file that has the same name, the VERY slow and eventual failure of the procedure is on OneDrive’s fault, right? Since it still doesn’t support overwriting of files with the same name? Second, does OneDriveMapper support video playback/streaming? I’ve tried some video files and none worked. I tried a similar program and it was able to do… Read more »
Rahul
Guest

Will OneDrive Mapper work even if sync is restricted to only domain joined machines using Set-SPOTenantSyncClientRestriction?

Dwain
Guest

Hi Jos,

Great script!

Question regarding the $domain you mentioned it’s the UPN, what if you have let’s say 25 subdomains, for example:

rootdomain.com
nl.rootdomain.com
uk.rootdomain.com

Is it sufficient to only put rootdomain.com in this field, or do i have to use the wildcard *.rootdomain.com?

What if you have also another sso domain like
seconddomain.com

What would be the configuration?

$domain = “rootdomain.com,seconddomain.com”

But domains are using the same IdP.

Thanks!

Tony
Guest
Hi Jos, amazing work! your native authentication save me a countless hours of work/research! I’m trying your script in lab deployment with a new w2k16 RDS farm to fully test the compatibility with the rolling migration to Office365 world. At the moment we are using ADconnect SSO without ADFS (planned when we have fully owned IP address space) so i’m using native+password_input method but i’ve encountered a small problem: load/storeSecureString use ConvertTo-SecureString that’s machine dependant and we are loadbalancing users..the result it’s a new credential prompt when landing to a not already logged in RDS host: changing ConvertTo-SecureString to use… Read more »
Tony
Guest

Hi ,
just found a more up to date method after a quick search:

https://gallery.technet.microsoft.com/Manipulate-credentials-in-58e0f761

Ian
Guest

OneDriveMapper_v3.06 works with the Azure AD SSO new feature really well..

Would be good to be able to rename the progress bar from “OnedriveMapper V3.06” to something else

Ian
Guest

Found the line :_)

$label1.text=”OnedriveMapper v$version is connecting
your drives…”

Todd Henry
Guest
This new 3.x native auth is amazing. However, we use ADFS and a hybrid SpO/On-Premise installation, and the native auth approach prodsuces a SpO cookie that is only valid for SpO document libraries (e.g., if I launch IE after the script runs, I can access SpO but still see my ADFS login page when I try to access on-premise content). Is there a way to tweak the native auth approach so that the cookie is valid for both the SpO libraries and on-premise doc libraries (so that IE is already “signed in” in both environments after the script runs)? Thanks.
Richard Maresca
Guest
Hello Jos , We are getting the following errors running V3.06: INFO | NOTICE: HKLM:SoftwarePoliciesMicrosoftWindowsCurrentVersionInternet SettingsSecurity HKLM only not found in registry, your zone configuration could be set on both levels ERROR | Possible critical error: “Our Sharepoint.com” not found in IE Trusted Sites on user or machine level, th e script will likely fail ERROR | Possible critical error: “Our Sharepoint.com” not found in IE Trusted Sites on user or machine level, the script will likely fail ERROR | ERROR: WebDav File Locking support is enabled, this could cause files to become locked in your OneDrive or Share point… Read more »
Richard Maresca
Guest
Hello Jos , We are getting the following errors running V3.06: INFO | NOTICE: HKLM:SoftwarePoliciesMicrosoftWindowsCurrentVersionInternet SettingsSecurity HKLM only not found i n registry, your zone configuration could be set on both levels ERROR | Possible critical error: usoncologynet.sharepoint.com not found in IE Trusted Sites on user or machine level, th e script will likely fail ERROR | Possible critical error: usoncologynet-my.sharepoint.com not found in IE Trusted Sites on user or machine level, the script will likely fail ERROR | ERROR: WebDav File Locking support is enabled, this could cause files to become locked in your OneDrive or Share point site… Read more »
Piotr
Guest

Hi again.
Normally when you put files into OneDrive folder they are not moved there but backed up to the MS cloud. Meaning you still have your copy of the files locally so you can access them when you don’t have an internet connection.

Your sript will only work if there is an internet connection. Is there a way for the files to be both locally and on the mapped drive?

Piotr
Guest

Hi.
The mounted OneDrive partition has the size of the system partition.
In my case, I have 2 partitions, the second one has all of the profiles of the users.
The script still mapps the folders, however the size of the onedrive partition is equal to that of the system partition which is a lot smaller then the partition which actually holds the data.

Is it possible to change the size of the ondrive partition / change the partition it’s trying to imitate?

Leah
Guest

Hi Jos! Thanks so much for all your work on this! Just one small request, is it possible for you to please add Desktop (and Favorites) redirection in a future revision? We’ve had issues with our users saving things to the desktop and losing them. I’ve added it to the current release myself for the time being, but I imagine others have had this issue as well so it’s probably a useful addition?

Piotr
Guest

Hi.
I also need to map Desktop folder to OneDrive, sadly whenever I add it to the script the whole thing just stops working. Is it possible for you Leah to send me the working version or at least give ma a clue what I’m doing wrong?

It’s possible that the mistake is somewhere here:
$res = Set-ItemProperty “hkcu:softwaremicrosoftwindowscurrentversionexplorerUser Shell Folders” -Name “Desktop” -value $myDesktopNewPath -ErrorAction SilentlyContinue
$res = Set-ItemProperty “hkcu:softwaremicrosoftwindowscurrentversionexplorerUser Shell Folders” -Name “{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}” -value $myDesktopNewPath -ErrorAction SilentlyContinue

Piotr
Guest

It finally worked but only when I replaced one of the existing folders (Video / Desktop, etc.) with the Desktop folder as opposite to adding new lines into the script.
I don’t know why just adding a new folder info into the script not only does not work but actually stops the rest of the script from working.

sjno
Guest

Awesome script, Jos! Can’t tell you how appreciative I am of the work you put into this. It was working very well for me last night, but today I disconnected all my maps and tried to “start from scratch” and it is blowing up on my SharePoint sites. I’m getting the dreaded “ERROR: detected string error 224 in return code of net use command.” I’ve tried setting all sorts of combinations in Trusted Sites, I don’t believe kb2846960 applies to me since I’m on Win10v1607, I’ve tried tweaking my URL’s…. no dice. Any other suggestions?

Ivan
Guest

How would i deal with multiple UPN’s in our environment? We use over 10 UPN’s depending on their email address (i.e. email maps to UPN in our environment).

frank
Guest

I am having an issue with mapping the the sharepoint libraries. I keep getting the following errors:

03/27/2017 16:40:18 | INFO | Attempting to detect username at https://mtaandao-my.sharepoint.com/_layouts/15/MySite.aspx?MySiteRedirect=AllDocuments, waited for 58 seconds
03/27/2017 16:40:20 | INFO | Attempting to detect username at https://mtaandao-03/27/2017 16:40:23 | INFO | OnedriveMapper has finished running
03/27/2017 16:40:23 | WARNING | restartExplorer is set to False, if you’re redirecting My Documents, it won’t show until next logon

Not sure what i am missing.

trackback

[…] OneDriveMapper […]

adam
Guest

Hi! What are the criterias of authentication in “NATIVE” mode? My clients don’t have office installed for which I understand is a must for the “IE” method..All the time I have tried running the script it has fallback to IE whether I have office or not installed??

Jamie
Guest

Hi, i use the script to map a SharePoint network drive.
Sometimes it works, but 3 of the 5 times this error shows up

ERROR | We do not seem to have been properly redirected after signing in.
ERROR | native auth login mode failed, aborting script

Does anyone gets the same error ? or has someone a solution to this error.

Jamie
Guest
Hi Jos, I’m using Version 3.05 of the OneDrivemapper script. But it doesn’t wanna work, it shows error 224. ERROR | failed to contact X: after mapping it to \domain.sharepoint.com@SSLDavWWWRootproductiestage, check if the URL is valid. Error: Toegang geweigerd. Voordat u bestanden op deze locatie opent, moet u de website eerst toevoegen aan de lijst met vertrouwde websites, naar de website browsen en de optie voor automatisch aanmelden selecteren. Systeemfout 224. Toegang geweigerd. Voordat u bestanden op deze locatie opent, moet u de website eerst toevoegen aan de lijst met vertrouwde websites, naar de website browsen en de optie voor… Read more »
Andrew F
Guest

Hi Jos,

Sorry, I’ve got 2 issue with the new script 🙁

First is it doesn’t seem to play nice with our proxy server. When using our proxy.pac the script falls back to IE mode, reporting “Proxy Authentication Required”.

The second is when I disable the proxy I’m getting the following:

Failed to set test cookie, script will fail: Exception calling “SetWinINETCookieString” with “3” argument(s): “Exception setting cookie: Win32 Error code=2”

detected string error 224 in return code of net use command, this usually means your trusted sites are misconfigured or KB2846960 is missing

and it fails to map the drive.

Profex
Guest
Hello Jos, thanks a lot for all of your efforts you have put into this script and into new version 3.05! We are using your script since quite a while with great success. I am currently testing new version 3.05 and I am unfortunately facing an issue with SSO using the native engine. I do receive the following error message and then the script just stops: 03/21/2017 09:50:08 | INFO | Login attempt using native method at tenant XXX 03/21/2017 09:50:10 | INFO | Received API response for authentication method: Federated 03/21/2017 09:50:10 | INFO | Authentication target: https://xxx.yyy.zzz (URL… Read more »
akkie3000
Guest

Works like a charm, amazing!

Daavid
Guest

Hi Jos,
We’re current using AD DirSync sync engine, and your script works fine. We’re thinking about upgrading to Azure AD Connect. Will your script 2.53 still work?
Thanks. David.

Stig
Guest

Looks like the WebClient service have been removed with tke latest Windows 10 updates ! (ver.1607 Build 14393.953) Anyone else seen this ?

Øystein
Guest

Hi Jos,

First of all, thx for a great tool.
I have a scenario with o4b in Office 365 and some SharePoint librarys running on-prem. I am able to map to o4b just fine, but I am not able to map the on-prem SharePoint librarys. I have tried a lot of different configs now but I have had no success. Should this be possible using your script, and if so can you give some pointers to what may be wrong? I do not get an error message it just hans on the point in the script where it should map the library.

B.r,
Øystein
———–

Tyler
Guest

Hey Jos, love the mapper. However I can’t get it to upload larger files… 360mb+ I’m running windows 10 and have tried the registry edits from Microsoft page but it still does not work… Any ideas? I get mixed results when trying to upload, errors about the file cannot be located and to try again… even though it hasn’t moved. These are video files mainly also. Any help would be very much appreciated.

Andrew F
Guest
So far so good. The script works well. The only issue I’ve found is when domain joined laptops leave the site. Then the user receives a “Could not connect to your corporate network” message, even if the drive is already mapped. I realize I could suppress this message, bu maybe a check for the drive early in the script would be a better resolution.. However that doesn’t help if the drive has not been mapped. When the use is off-site could it be possible to have a fallback userLookupMode where the user is prompted for their username and password when… Read more »
Mike
Guest

Hi Jos

Can I redirect IE favourites using the script? If I use gpo it doesn’t work properly as the script is processed after the gpo redirection setting

Thanks

TechieGuy17
Guest

Hi, Amazing script and works brilliantly. One quest i have is that can IE favourites be redirected to the mapped drive in the script? Ive tried it using GPO but im guessing the gpo runs before the drive gets mapped and therefore doesn’t work

We have users that store their IE favourites in there Onedrive

Rob
Guest

Using Okta for SSO & receiving the following error “Failed to find the correct controls at http://hcnokta/IWA/auth.aspx to log in by script, check your browser and proxy settings or check for an update of this script. Exception setting “value”: “The property ‘value’ cannot be found on this object. Ver
ify that the property exists and can be set.” I modified the inputs for the Okta suggested variables, but still not working. Any assistance would be great. Thanks!

Dave
Guest

Hi Jos,
I’ve been using your script a while now at the school i work for, all working fine with windows 7 & 10, and my users love the simplicity it brings in moving their lives to OneDrive.
I see that v3 will not use IE to map the drive anymore which sounds good. Can i get involved in the beta testing for v3 please?

Gary
Guest

Hi Jos, Am getting the following error on 2008 R2 XenApp/RDS server:

Failed to browse to the Office 365 Sign in page, this is a fatal error Exception calling “Navigate” with “1” argument(s): “Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))”

I know there is nothing wrong with the script as it works on another farm, but wondering if you have any idea what could be causing this issue? I’m using version 2.53. Wondering if some kind of pre-requisite is not installed?

Nico
Guest

Hi Jos,
I Really like your script! I use it at multiple customer sites.
I’am trying to use it on a Windows 2016 RDS server in combination with Azure AD Connect SSO. The problem is that i keep getting error 224. I have no idea why.
I have installed the webdav client feature.
When i use “Open in Explorer” i can browse my OneDrive without any problems.
Do you know in witch direction i can find a solution?

Aaron Armstrong
Guest
Hi All, This looks like the answer to my problems of moving our users to the cloud. Alas at the moment it doesn’t work. i get the error described below, the error 224 about trusted sites. I also get the login prompt, we already have SSO so didn’t think i would get this. Anyway, once i have logged into the prompt i get the error message and then it logs me out and i have to login to access my O365 applications, its as if its forgot the SSO, i suspect this is supposed to happen. Anyway any ideas of… Read more »
Aaron Armstrong
Guest

I found this solution that JOS had put further down and it worked for me.

$skipNormalLogin = $False
if($userLookupMode -le 3){
to
$skipNormalLogin = $False
if($userLookupMode -eq 3){

Thanks again as works great.

Mrcs
Guest

This also worked for our environment!

Bawbaw
Guest
For those of you who use the Azure AD Connect SSO, I made a slight adjustment to the script for it to work for our environment that might work for you. I was having an issue where the script was adding the 2 Microsoft URL’s needed for SSO into the registry, but because I already have a GPO that has other trusted sites being provisioned, when the script was adding the Microsoft URLS they were not being noticed by windows because the GPO settings were taking precedence. So the script puts the site in “hkcu:softwaremicrosoftwindowscurrentversioninternet settingszonemapdomains” which is the correct… Read more »
Gee
Guest

Hi Jos, great tool thanks for helping your fellow IT professionals!

One issue, we have pushed out onedrivemapper but we have an instance where two users are unable to have their drives mapped. The office365 box appears but does not accept their password, however their password is correct as they can use this same password to log into portal.office.com to access files that way instead.

Can you advise on any pointers here and if you have come across this before? Drives map fine for all other users in the company.

Version is: 2.53

Thanks in advance and Kind Regards

Gee
Guest

I found the solution for this. I noticed the user name for these two users were pointing to ‘mydomain.local’ instead of ‘mydomain.org.uk’. Changing this away from .local instantly stopped the password prompts and the drives mapped straight away on next logon!

Kevin De Schrijver
Guest
Just a small request: The current message for an outdated OneDriveMapper version is too negative in my opinion. I’ve manually edited it for my deployment but it could be less negative IMO. Upgrading the script doesn’t deserve such a harsh alert given that not always updates have an impact on eveery type of user. It currently sais: OnedriveMapper version outdated 🙁 People freak out when they see messages like that. Especially with the inverted smiley. I currently have it changed to: New OneDriveMapper version available. It conveys the same message without any feeling like they’re horribly outdated, unsecure or whatever.… Read more »
Bas
Guest

Hello Jos,

Great script!
It works great, but for some reason it doesn’t run hidden at logon.
We used gpedit.msc to run the script at logon.

The argument -WindowStyle Hidden is configured in the parameters.

Best regards,

Bas

Chris
Guest

Also having this issue, did you manage to resolve it?

Steven
Guest

v2.53 works in our organization perfectly on Window 7, but is failing on Windows 10. Both use identical IE GPO settings.

On Win10, this error shows up:

ERROR | Failed to browse to the Office 365 Sign in page, this is a fatal error The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED))

And there is an open IE browser Window at this location: https://login.microsoftonline.com/logout.srf.

trackback

[…] I am starting to look at – OneDriveMapper powershell script – OneDriveMapper | Liebensraum I can get the script to map the one drive as home drive and can get it to map a share point drive […]

Mark
Guest

Great script, I am having a problem of getting more than one sharepoint drive mapped 🙁 i can get it to map one drive and thats it. I change the one drive to the other drive and it maps fine. Just can’t get it to map more than one drive. Please help

Stig
Guest

I’m trying out v2.53 with Azure ADC Passtrough and SSO, but users are still prompted to enter password. Is this expected behavior ?

Aart
Guest
Fantastic script, thank you. This is going to be very useful in our Citrix/TS environment. I’ve a question about SSO. We configured AzureAADConnectSSO and enabled this option in the script, but OneDriveMapper isn’t using this and keeps asking the user for his password. If the user enters his password all is working well, but I think this isn’t the intention of this option in the script. The log full log is added below. Can you tell me how I can resolve this and use AzureAADConnectSSO instead of asking the password? For all other things and in all browsers the AzureAADConnectSSO… Read more »
Sam
Guest
Hi Jos! Thank you for sharing this wonderful tool with us. It has been working great when we execute the script manually. However, whenever we try to schedule it through Task Scheduler, it never works. We tried a combination of different user accounts including Domain Admin, local Administrator and normal user accounts, all fail. We also tried turning off and on the “Run as Administrator” setting in Task Scheduler and it still doesn’t work. When running with “Run as Administrator” setting we see that the log tries to schedule another task for OneDriveMapper but a task doesn’t actually get created.… Read more »
Phil Warren
Guest

Occasionally the drive Mappings are dropping from my Windows 10 machine. if i try to re run the script i get the following error in the log.
02/07/2017 09:32:02 | ERROR | Failed to find the correct controls at https://login.microsoftonline.com/login.srf?wa=wsignin1.0&rpsnv=4&ct=1486459912&rver=6.7.6640.0&wp=MCMBI&wreply=https%3a%2f%2fportal.office.com%2flanding.aspx%3ftarget%3d%252fdefault.aspx%253fwa%253dwsignin1.0&lc=2057&id=501392&msafed=0&client-request-id=222326aa-b04e-4887-b89b-e095341050b6 to log in by script, check your browser and proxy settings or check for an update of this script (2). The element cred_keep_me_signed_in_checkbox was not found (2) or had no tagName

Phil Warren
Guest

i am also getting this error.
02/07/2017 09:52:28 | ERROR | Failed to find the correct controls at https://portal.office.com/adminportal/home#/homepage to log in by script, check your browser and proxy settings or check for an update of this script. The element cred_password_inputtext was not found (2) or had no tagName

Matt
Guest
Hi, we are using your script very successfully and in the process of rolling this over to all users. On our Windows 10 machines all is well and the drive is mapped within a minute or so, so all is well.. However, on the remaining Windows 7 PCs we have the script not only takes a very long time to start, it then seems to pause for sometimes minutes doing nothing (looking at the log updating) and then will continue. No problems recorded and no issues, and it does map eventually. Any reason why the script would be so much… Read more »
Andrew
Guest
Fantastic script, thank you. This is going to be very useful to my school. I’ve started testing/deploying and all seems good, except we appear to be getting the problem with Office prompting for credentials when opening a OneDrive document. I’ve read your comments in the FAQ about KB943280, but that only seems to apply to Windows 7/Vista. We are running Windows 10. Do you have any advice regarding this operating system? Also, we have migrated some of our student home drives to OneDrive, in AD I have set their AD home directory attributes to their OneDrive WebDAV path with the… Read more »
Rob
Guest

Jos,

We’re having an issue with your script.

One of our users is getting “01/26/2017 09:46:18 | ERROR | ERROR: detected string error 224 in return code of net use command, this usually means your trusted sites are misconfigured or KB2846960 is missing”

His log has: “01/26/2017 09:45:31 | INFO | detected SSO option for OnedriveMapper through AzureAD, attempting to login automatically”

Whereas mine, which works has: “01/26/2017 13:07:28 | ERROR | failed to use Azure AD SSO for Workplace Joined devices”

Peter
Guest

I keep receiving error 59 when a user runs your script on a Server 2016 RDS server. However an administrator works fine.

01/27/2017 14:39:53 | ERROR | failed to contact Y: after mapping it to \tenant.sharepoint.com@SSLDavWWWRootXXXShared Documents, check if the URL is valid. Error:
An unexpected network error occurred.

System error 59 has occurred.
An unexpected network error occurred.

Any suggestions on what the cause may be?

wpDiscuz