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 200,000 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.11.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 mapping to Sharepoint Sites, O365 Groups or Microsoft Teams
  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. Set $O365CustomerName to your Tenant Name (xxx.onmicrosoft.com)
  6. Set $driveletter to the driveletter you wish to map to OneDrive for Business and are not using the Cloud Edition
  7. Set $userLookupMode to what matches your environment
  8. Set $adfsWaitTime to 0 if not using ADFS
  9. If you wish to map Sharepoint libraries, change line 114 of the script ($sharepointMappings += XXX) if you’re not using the Cloud Edition
  10. disable file locking
  11. Run it on a representative test machine / user and thoroughly check the log it generates in %APPDATA%
  12. 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’m not a real programmer, this code is meant as a Proof Of Concept. I do not guarantee this product will work in your setup, and I offer no dedicated support, I try to help everyone on a best-effort basis but also have to work for a living. So make sure you test well and understand the code before you use it. 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

1491 Comments on "OneDriveMapper"

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

[…] OneDriveMapper […]

Chris L-M
Guest
Hi Jos, Awesome script, thanks for making it. I wanted to inform you of issues we have been having with “ie” mode for the last couple of weeks. When logging in to O365 the script is not finding the expected URL for a successful login. As a result, it asks for a new password, then tries again, asks again, then the script continues, gives an error message with the URL that it didn’t like, maps the drives correctly, then pops up an error message saying that mapping was unsuccessful. I suspect that Microsoft have changed the format of the URL… Read more »
Bobby Lansing
Guest

Same issue Jos. We discussed this a few months ago, but I think Chris L-M explained it better.

Simon
Guest

Hi Jos,
The POST Login redirect issue seems to have reared its head again.
Are you aware if Microsoft has made any URL changes again that could be effecting the script?
Thanks
Simon

Handun
Guest
Hi Jos, I have used your script to map SharePoint drives in one of my client’s environments. However, every time when the scripts is executed, it asks for a Office 365 password two times. I haves used the version 3.08. After getting the password, even with several errors, script runs until the end, and maps the drives. However, users are complaining that they have to enter O365 password twice. I have used a Logon script to execute the PowerShell script. Please advise. Following is the error log. 07/03/2017 14:58:53 | INFO | —–07/03/2017 14:58:53 OneDriveMapper v3.08 – bookkeeper on TEST-WS03… Read more »
trackback

[…] OneDriveMapper […]

Mickael Selander
Guest

We just started to get an login promt seems to only accure on our Win7 machines, ADFS says wrong password or username but I can successfully login with SSO on the users machine but not in the script. anyone recieved anything simulare?

Mickael Selander
Guest

Spoke to soon seems to be everyone or almost everyone,
I altered the parameters so it couldn’t continue if no ADFS server is found, then I get an error saying that SSO Provider is available

Mickael Selander
Guest

That’s version 3.07 that gives that error but that seems to still map the drive but version 3.08 still promts for password

Mickael Selander
Guest

now if i set abortifnoadfs to true i get the same error on 3.08 and a mapping but also the same error

Mickael Selander
Guest

I turn of error showing so that could work for now but something regarding the connection to our ADFS server seems to be problematic for the script. SSO for Office365 and other applikations work fine.

Kevin De Schrijver
Guest

The script seems to return error at the moment. Sharepoint is up and running and no outages reported. But the script needs to be run several times and password needs to be entered multiple times (even with username and password stored) at the moment. Could be a Microsoft issue or perhaps they’ve changed something the required an update to the script.

Chris L-M
Guest

This is also happening to everyone in my office. We were successfully using v2.53 for a long time. Last week it started asking for the password, then asking again, then mapping the drives, then saying that it had failed. It seems that MS have changed the format of the URL that is received after a successful login and this is causing the script to incorrectly identify that login was not successful. 3.08 fixes the issue WHEN native auth works, which for us seems very hit and miss.

Kevin De Schrijver
Guest

I can replicated the problem anywhere using UserMode6. It fails a couple of times on the password. If you run the script enough times it goes through eventually but not without errors. Definately could use a comment from @Jos

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 […]

trackback

[…] Posted by nickbro We started using the onedrive mapper which is free from OneDriveMapper | Liebensraum Just did a copy job with all the user files up to their personal onedrive for business accounts […]

Ronald
Guest

Hello, Jos great script. We are testing it right.
The mappingscript works perfectly except one thing.
We have use O365migrator to migrate the homefolder to a subfolder on Onedrive.
We want Onedrivemapper to map to that subfolder.
So i used the the variable $redirectToSubfolderName in the script but OnedriveMapper does map to that subfolder but to the root of the users Onedrive

Ronald
Guest

I found out that the variable is used for redirecting folders like “favorites,downloads,etc”

Eugene
Guest

Does anyone know if you have a drive mapped to a specific letter, if the scipt recognize that and not overwrite the previous mapping?

Buster
Guest

Jos, Any version above 2.53 for me is broken and requesting user password. Oddly though 2.53 still works without issue. I’ve been testing with 3.06,3.08,3.09,3.10 and 3.11

Andrew
Guest
Hi Jos. I’ve moved on from OneDrive mapping (which is working great with your script) to a sharepoint site. In your installation comments you advise not to use spaces in the path, but this seems unavoidable if mapping to the shared documents space on the sharepoint site (eg our $sharepointMappings += “https://ourtentant.sharepoint.com/staff/humanresources/Shared Documents,HumanResources,S:”). What are the consequences of this space? It seems to work as written. What problems should we be looking for? I’m really not very familiar with Sharepoint – we’re only just starting to move towards it. I notice in your code example in the script that you… Read more »
Toby Bierly
Guest

I can’t remember exactly where, but a couple weeks ago I was noticing an error in the script log because of the space in Shared Documents. I think the script ended up completing successfully, but I remember I was able to get rid of the error altogether by changing that part of the SharePoint mapping path to Shared%20Documents

Andy Harper
Guest

Hi Jos – Very long time user of the scripts since early on, seems like yesterday. So I continue to be thankful as you help the teachers at our school be more efficient with their time in using OneDrive like a local path. Just wanted to share that I did the upgrade to 3.11 and still got the 3 prompts for user initial login (cache). I removed the “?msafed=0” from the script and that seemed to fix it immediately. Just an fyi, or do you have thoughts?.. Thank you – Andy

L_D
Guest

Hi there

These are my PS messages

“Logged into Office 365!”

Retrieving Onedrive for Business cookie step 2 at https://onedrivemapper-my.sharepoint.com/_forms/default.aspx

” Waited for 0 seconds for O4b auto provisioning…” and it never goes past this.

What am I doing wrong if I am able to login?
I have an idea that SPOTenantSyncClientRestriction has been enabled. Would this script connect to my OneDrive despite not being added to a domain?

rashannw
Guest

$Domain is not stipulated in the script. Is there a reason why it is missing?

trackback

[…] OneDriveMapper […]

Notty
Guest

Hi Jos, You have created a great script in the world!! Respectful.

By the way, as you know the authentication UI of Office 365 changes soon. If possible we would like to improve the script to accommodate the new UI.
Are there plans for improvement??

bashr
Guest
Hi Jos, Great Script!! I have been using it for a long time now but since a couple of days I am having problems to run it. Log file: 00000001 08/11/2017 00:10:56 | INFO | —–08/11/2017 00:10:56 OneDriveMapper v3.10 – userX on DESKTOP-sdfssd starting—– 00000002 08/11/2017 00:10:56 | INFO | Script elevation level: User 00000003 08/11/2017 00:10:56 | INFO | Set TLS protocol version to 1.2 00000004 08/11/2017 00:10:56 | INFO | You are S-1-5-21-1149768150-2677177873-1229523166-1001 running on Windows 10 with IE 11 and Powershell version 5 00000005 08/11/2017 00:10:56 | INFO | Loading CookieSetter… 00000006 08/11/2017 00:10:56 | INFO |… Read more »
Mark C
Guest

Hello Jos,

Awesome script by the way just have a quick question.

We used an old version 2.39 and updated to 3.10 as it was having issues with the mapping.

Now it keeps prompting for a password which after entering 3 times does show the mapping, but cannot interact with any files as it is not fully logged in

Any comments will be appreciated!

Thank you

Peter H
Guest

Hi Jos, great new release as usual. One question I have which may or may not have been covered here: if I run this on Server 2012 R2 the script does not run for maybe 4-5 minutes then I will get a visual pop-up of the PowerShell script and it will run perfectly fine and map my drives…
Any ideas what I’m missing?

Simon
Guest
Hi Jos, I have 2 questions, first one is? We have updated to use the v3.10 but we are still getting the ‘Mapping cannot continue because we could not contact Office 365’ error pop up but the drive maps fine? This is occurring on laptops & desktops. Here is the part of the log where the error occurs; 08/10/2017 15:11:00 | INFO | Zone 2 was set to 3, setting it to 3 08/10/2017 15:11:01 | INFO | Base URL: https://portwaratah-my.sharepoint.com/_layouts/15/MySite.aspx?MySiteRedirect=AllDocuments 08/10/2017 15:11:01 | INFO | Zone 3 was set to 3, setting it to 3 08/10/2017 15:11:02 | INFO… Read more »
sebus
Guest
Not working (3.09 and 3.10) for the last few days: ERROR | There was an issue while trying to log in during attempt 3 INFO | detected user logged in Tile in IE INFO | login detected, login function succeeded, final url: https://portal.office.com/AdminPortal/Home#/homepage INFO | IE login function succeeded INFO | Detected user: user_domain_com INFO | Onedrive cookie generated, mapping drive… INFO | Mapping target: \tenantname-my.sharepoint.com@SSLDavWWWRootpersonaluser_domain_comDocuments 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 ERROR | failed to contact O: after mapping… Read more »
trackback

[…] OneDriveMapper […]

Morten Wiingreen
Guest

Hi Jos.

When using OnedriveMapper 3.09 in IE mode (debug) Internet Explorer stops at loginpage (https://login.microsoftonline.com) showing my upn name.
If I do nothing the script waits for sso (10 sek count) and eventually asks for my password two times. Onedrive is mapped if I type in password.
If I press my name in the browser and logs into https://login.microsoftonline.com, the script is finishing without any problems and onedrive is mapped.

Any idea why IE does not log in ?

Best regards and thanks for a great script.

Ferron
Guest

Hallo Jos,

Wat is er precies veranderd bij Microsoft met de POST login redirect? Heeft Microsoft hier zelf wat over geschreven? Ik heb namelijk last van een probleem dat hierdoor is veroorzaakt, maar ik kan nergens vinden wat veranderd is.

Alvast bedankt!

Matt R
Guest

Hi Jos,

First of all I wanted to thank you for the script. I am having an issue with delayed logins and with drives failing to map. I think it is because I have some settings wrong. Is there a way you can look at the log and make a recommendation?

Phil Warren
Guest

When a new user logs on for the first time explorer.exe hangs indefinetley unless you manually start it from task manager. Once the user has a roaming profile the script runs and explorer starts as expected. if we remove the logon script then a new user logs on as expected so we know it is something in one drive mapper that is causing the issue. Any ideas why this might be happening would be gratefully appreciated.

Matt
Guest

When we try to map our sharepoint drive, we receive the error

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.

If we login to IE and retry, the script completes. Should the script work without the requirement to login manually?

Many Thanks

MJ TFSB
Guest

How do I log back into my OenDriveMapper Configuration? I can’t find a link or URL. I am having difficulties getting the msi to run on non-administrator users and need to check my settings.

Gary
Guest

Hi Jos,
v3.09 – It appears that the check for MFA is only used in the IE mode authentication. Can you work this into the native auth mode as it is an issue we are encountering, especially a challenge when users need to re-validate their MFA details.

Also the script appears to fail if the user has a profile configured in AD to point to a share (their ‘legacy’ home drive), but if we clear the profile then it works perfectly. If the profile is mapped then there is an error setting the cookie.

Many thanks

Duncan Wraight
Guest

Hi Jos. I’m encountering a bizarre problem on some of my machines where, when running the script as a GPO logon script (using Powershell.exe and the associated commands, as instructed), the log in %appdata% appears to suggest that the script tries to run a scheduled task… then nothing happens. Have you seen this before? 07/17/2017 12:03:09 | INFO | —–07/17/2017 12:03:09 OneDriveMapper v3.09 – DS on AHS-31-21 starting—–
07/17/2017 12:03:09 | ERROR | Script elevation level: Administrator
07/17/2017 12:04:10 | INFO | Scheduled a task to run OnedriveMapper unelevated because this script cannot run elevated
07/17/2017 12:04:10 | INFO | Scheduled task started

Gabe W
Guest

Hi, we do not use ADFS but we do use OneLogin. This seems to cause problems because it seems to redirect to OneLogin and then not get the response it is expecting and then fails.

| ERROR | Failed to find the correct controls at https://xxxxx.onelogin.com/login to log in by script, check your browser and proxy settings or check for an update of this script (2). Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).

Is there a way around this? Other than using IE auth and getting the user to have IE already signed into Sharepoint Online.

Thanks

Luke Pollard
Guest
Hi, I’m trying to set this script up for our academy so that we can map out onedrive and sharepoint sites. I’m using the RM Unify SSO, and despite reading through your entire script I and changing the relevant logon settings still get a “WARNING | Federation Services did not sign us in automatically…” If I then manually type the password it throws an error in powershell on lines 1787 InvokeMethodOnNull, 1789 MethodNotFound and 326 URIFormatException. Using version 3.09 Any chance I can pass you some logs to take a look? I’d really love to get this working with RM… Read more »
Luke Pollard
Guest

I’ve noticed using fiddler when I run your script that the RM Unify provides a 302 redirect to the logon page, is your script trying to post the logon credentials to the page before the 302 redirect, if so is there a way to get it to post the username/password after it has redirected?

I have a saved a session archive from fiddler if you would like to take a look?

Thanks in advance,
Luke

Luke Pollard
Guest
So some further digging, RM Unify works in ie mode however it still prompts for a password when logging in. I’ve managed to add a few lines of code which triggers the RM Unify SSO page (https://.rmunify.com/sso) first, which then automatically logs onto Office 365 using the rest of this script. I’m just doing some further testing and then I’ll publish the code changes which has made this work. Only problem I’m finding is in Windows 10, when exploring through the folders it is extremely slow and often crashes the explorer. I have looked through the FAQs and disables auto-proxy… Read more »
Hari
Guest

Hello Luke

Is the script working fine for you with RMunify? Could you please share to me?

Duncan Wraight
Guest

OK, sorry Jos, I’m back. I posted a comment earlier about my username being incorrect then I sorted that by changing the $userLookupMode variable. However, having changed that, I still end up with the same result: 07/13/2017 11:42:20 | INFO | login detected, login function succeeded, final url: https://www.office.com/?auth=2&home=1&from=PortalLanding&client-request-id=2c44963b-4058-4005-b35c-b806fa46f297
07/13/2017 11:42:20 | INFO | IE login function succeeded
07/13/2017 11:42:24 | INFO | Attempting to detect username at https://[mydomainreplacement]-my.sharepoint.com/_layouts/15/MySite.aspx?MySiteRedirect=AllDocuments, waited for 0 seconds

Is there somewhere I could send you my full log to have a quick look? Hopefully it’s something silly that I’m doing wrong.

Thanks,
Duncan

Duncan Wraight
Guest
Hi Jos. Firstly, thanks for the script – loads of work and it’s a brilliant implementation. I’m having issues with the username side of things. Early on when the script runs, it says: 07/13/2017 11:19:41 | INFO | Login attempt using IE method 07/13/2017 11:19:41 | INFO | Found sign in elements type 1 on Office 365 login page, proceeding 07/13/2017 11:19:41 | INFO | Found sign in elements type 2 on Office 365 login page, proceeding 07/13/2017 11:19:41 | INFO | Found sign in elements type 3 on Office 365 login page, proceeding 07/13/2017 11:19:42 | INFO | Will… Read more »
Duncan Wraight
Guest

Ahhh.. never mind, I’ve just found this line in your config! $userLookupMode = 4 #1 = Active Directory UPN, 2 = Active Directory Email, 3 = Azure AD Joined Windows 10, 4 = query user for his/her login, 5 = lookup by registry key, 6 = display full form (ask for both username and login if no cached versions can be found)

Steph
Guest

Hi Jos, I’m not sure if it’s a big or the way you intended it; but if the mapping goes through successfully and then somehow your drive(s) get disconnected, but the tmp files still exist, it does not remap your drives. I’m using v3.09. Thanks!

Yasin Akbulut (NL)
Guest
I have a question about this submission to the FAQ of yours, it still doesn’t work with my GPO configuration: “How do I run the script from a GPO? First off, do not run it as an embedded powershell script. Add it under ‘scripts’ as a normal script with commandline/name: Powershell.exe Then the arguments or parameters you should specify are: -ExecutionPolicy ByPass -WindowStyle Hidden -File if you omit -WindowStyle Hidden the script will execute visibly. File HAS to be the last parameter.” It’s still not working and i don’t quite understand with your instruction you submitted in your FAQ, so… Read more »
Yasin Akbulut (NL)
Guest

It’s still not working and i don’t quite understand [with] your instruction you submitted in your FAQ, so I will tell you what kind of GPO I’ve configured*

Peter H
Guest
Hi Jos, Script working amazingly well with no errors or warnings apart from one which keeps cropping up and I think i’ve mentioned previously… ERROR | ERROR: Failed to connect to API url for version check: http://om.lieben.nu/lieben_api.php?script=OnedriveMapper&version=3.09 Exception calling “GetResponse” with “0” argument(s): “The remote server returned an error: (407) Proxy Authentication Required.” Is there a line that can be added to the script anywhere to use default credentials or something similar to get around this. It isn’t detrimental to the Mapper functioning correctly, it’s just that it always says the script is out of date no matter how new… Read more »
Kevin Davies
Guest

Jos,

Where can I contribute to your wonderful script.

Cody Belcher
Guest
Hello Jos, (Apologies if this is a duplicate post, I am not sure I submitted my comment/question correctly the first time) My organization has made several changes over the past couple of months and of those was an upgrade from ADFS 2.0 to 4.0! Prior to the upgrade we were using Onedrivemapper v2.53, and are now using v3.09. After these updates we are getting the warning below (from the log). Looking for some advice on how to proceed. The entire log is farther below. | WARNING | Federation Services did not sign us in automatically, retrieving user credentials.. FULL LOG… Read more »
Cody Belcher
Guest

Follow up to the above, we have found that in ADFS management, under Intranet, Windows Authentication was not listed. We added it and now the script is working with no errors.

*Note* – We had previously removed this because of an issue with staff, using a district Window’s device, could not access the Office 365 portal from home when using Internet Explorer 11. It was stating it could not contact ADFS. It would work in all other browsers. This is still the issue after re-enabling Windows Authentication.

Skrie
Guest

The script works great… but, I’m trying to roam the mapping after the script created it. We’re using mandatory profiles with VMWARE UEM for usersettings. I can’t really figure out how to keep the OneDriveMapping. Does anyone have a list of regkeys/appdata folders that would maintain this mapping after it was created?

Maritin
Guest

I have problems getting the Cloud version to work
if i make the same config in the script everything works fine, but the cloud version says cant connct to your network

Niglbrown
Guest

On one machine in my office I receive the following log entry:

’07/07/2017 13:06:24 | ERROR | failed to retrieve settings from lieben.nu using 5D57CFC9-733C-C530-C46D-056D911F1FDA because of Exception calling “DeserializeObject” with “1” argument(s): “Invalid JSON primitive: incorrect.”, content of request: ‘
I noticed this would be generated by the ‘ConvertFrom-Json20’ function which relys on web extensions.

Any thoughts? I have gotten around this by using the cache from another machine on this machine to load the configuration.

Bobby Lansing
Guest

Hey Jos,
How do you feel about making the progress bar color a variable so we can custom theme the progress bar? I can edit the code, but it would be cool for the cloud product as well.
Thank you for an awesome product!

Petter
Guest

Hi,
Could I use OneDriveMapper Cloud if I must use $userLookupMode = Active Directory Email ?

Rogier
Guest

Thanks for the updated version 3.09 Jos!
We had some issues this morning but this version works fine!

Kevin De Schrijver
Guest

I assume Jos is on holiday at the moment. Has anyone found a fix or workaround to the current issues with the script?

Toby Bierly
Guest
We and all our customers where we have deployed OneDriveMapper all started getting prompted 3 times for the user’s password and then the script fails. It will not succeed even with the correct password. We were running 3.06 but 3.08 fails as well. We just noticed this last night. We are not using ADFS. We are using $userLookupMode = 4 and storing the credentials in tmp files. The log doesn’t show anything that reveals the issue. All it says, after retrieving the password from the cache, is “ERROR | There was an issue while trying to log in during attempt… Read more »
smichael
Guest

Great Script Jos – is there anyway to make the Winform username dynamic & pull what a user types in instead of hard-coding something like a SP site?

David
Guest

Hi,

We have successfully got the script to map and it all works perfectly.

However, during the mapping process when a user initially logs on and it says “OnedriveMapper v3.08 is connecting your drives…” PowerShell opens in the taskbar and a user can then open a full PowerShell terminal before entering their Office 365 password.

I have hidden the script output etc, PowerShell still seems to sit in the task bar.

Is there anyway to hide any trace of PowerShell??

Thanks,

Patrick Lubbers
Guest

Hi Jos,
Since a week and a half the onedrivemapper script intermittently fails at our organisation. It seems to time-out.
Has anyone else reported this issue?
It doesnt matter if we use either 2.49, 2.52, 3.08

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

wpDiscuz