OneDriveMapper

OneDriveMapper is a free (non-commerial use), open source script I wrote to be used as a logon or on demand script to map OneDrive for Business and/or Sharepoint Online to driveletters and/or Network Locations, it has been downloaded over 2,500,000 times and has millions of users.

It was designed to run in scenario’s where using the Onedrive for Business client is not feasible, such as legacy 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.

Download open source version:

OnedriveMapper V3 / older releases (does not support all types of MFA, conditional access etc but has more features. Still seems to work on all OS’es but can be retired by Msft anytime without warning)

OnedriveMapper v4 (very lightweight and simple version that supports all kinds of MFA but depends on Internet Explorer)

OnedriveMapper v5 (next iteration of v4 using Edge instead of Explorer, but does not work on older OS’es like W2008/2012)

Enterprise alternative (with support & discount):

IAM Cloud Drive Mapper

How to install (instruction for V5)

  1. Make sure Edge Chromium is installed
  2. Make sure .NET 3.5 and PowerShell v3 or higher are present on the Machine
  3. Download the latest version at GitLab to a network share or your devices
  4. Download the Selenium Webdriver.dll from NuGet or GitLab to the same folder as OnedriveMapper.ps1
  5. Download the Edge msedgedriver.exe from NuGet to the same folder as OnedriveMapper.ps1 or ensure autoUpdateEdgeDriver is set to $True (default) and the user has write-access to the script’s location
  6. Add https://tenantname-my.sharepoint.com to your Trusted Sites list if mapping to O4B
  7. Add https://tenantname.sharepoint.com to your Trusted Sites list if mapping to Sharepoint Sites, O365 Groups or Microsoft Teams
  8. Add adfs.yourdomain.com to your local intranet sites (both http and https) to get SSO if you’re using ADFS. Make sure that whatever method you use to set this, runs BEFORE the script runs.
  9. Set $O365CustomerName to your Tenant Name (xxx.onmicrosoft.com) in the script’s source code
  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.

Maintenance

the msedgedriver.exe file requires that the version of Edge installed on your systems is similar. So if you update Edge, the edge driver also has to be updated. OnedriveMapper will try to do this automatically by default, but if the user that runs ODM does not have write access to the same folder as the script, this will fail and you will have to update the edge driver manually.

When do I use OnedriveMapper?

In short: only when you have no other choice!
With Files On Demand and GPO support for passthrough auth and automatic mapping of sharepoint and teams sites, the need for OnedriveMapper has been greatly reduced. When you’re thinking of adopting VDI, go Azure Virtual Desktop with FSLogix instead of OnedriveMapper.

Please try to make the effort to educate your users, don’t swim against the current; start embracing new cloud technologies.

If you really have no other option, e.g. you have automated processes you cannot yet rewrite to use the Onedrive API, or are working in a W7/W2012 multi user environment and can’t just use the web interface. Do make sure your systems do not fully depend on mapping drives as they could break at any time, WebDAV is not a very….’recent’ technology and Microsoft does not give any hard guarantees as till when it will be supported.

So what does OnedriveMapper do?

  • Runs at logon or on demand (group policy, RES, etc)
  • Maps to Onedrive for Business (with auto detection of the user’s URL)
  • Maps to Office 365 Groups and Teams
  • Maps to Sharepoint Online
  • No Sync, online WebDav connection over HTTPS
  • No user interaction if SSO is enabled
  • On Demand Provisioning of the OneDrive MySite
  • Detailed and configurable logging
  • Map based on AD security groups
  • Custom labeling of drives
  • 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 or Citrix Seamless Apps
  • Can redirect OS folders (like My Documents)
  • Can converge multiple mappings in a single driveletter
  • SSO for MDM Intune AzureAD W10 devices
  • Can be deployed as logon script through Intune
  • Can easily run from a shortcut as well

Recommendations

Limitations

  • If SSO is not configured or MFA is required, the script will show the user a popup to authenticate
  • This script does not work Powershell V2 or lower (comes with Windows 7), install V3 or higher
  • This script does not operate on Windows 2012 R2 (or lower) as the Selenium webdriver component does not support this.

Disclaimer

I’m not a real programmer, this code is meant as an example. 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 before you use it. This script may suddenly become obsolete without prior warning if Microsoft feels that WebDAV should no longer be supported. For an enterprise worthy and supported product, I recommend using IAM Cloud Drive Mapper instead of an open source script. If you use LIEBEN25 as referral code with IAM Cloud, you’ll get a 25% discount.

old changelog

FAQ

Subscribe
Notify of
guest

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

2.3K Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Ian
Ian
4 years ago

OnedriveMapper no longer mapping drives and coming up with error message that the website is not listed in the Trusted Sites list.. v3.13

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.

trackback

[…] OneDriveMapper […]

Edwin
4 years ago

Our mapped drives have stopped working. The error 224 is thrown when the NET USE command is executed. Did MS removed completely the “stay logged-in” option?

Bill Hixon
3 years ago

I’m having the dreaded 224 error come up regularly now. I’ve reset IE and rebooted, no change. I am getting this error before the 224:

Failed to set a cookie: Exception calling “SetWinINETCookieString” with “3” argument(s): “Exception setting cookie: Win32 Error code=4317”

Is this the cause, and if so, what do I do to fix this?

Rick de Vries
Rick de Vries
5 years ago

Anyone notice OnedriveMapper no longer mapping drives and coming up with error message that the website is not listed in the Trusted Sites list, while it actually is? I had a few users experience that in the past few days and each day another user experiences it, so the list of users unable to map is growing.

Pierre
Pierre
11 months ago

Hi, i add an issue with the v5 script with Terminal server with UPD. we have this message ERROR | Failed to load Edge driver, cannot continue. error details: Exception calling “.ctor” with “2” argument(s): “unknown error: MSEdge failed to start: crashed.  (chrome not reachable)  (The process started from msedge location C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe is no longer running, so MSEdgeDriver is assuming that MSEdge has crashed.)” the debug file of the driver give use that The GPU process has crashed 9 time(s) [8144:6328:1002/003038.737:FATAL:gpu_data_manager_impl_private.cc(426)]GPU process isn’t usable. Goodbye. i found the issue at line 1130 $global:edgeOptions.addArguments(“user-data-dir=$($Env:appdata)\Lieben Consultancy\OnedriveMapper\Profile”) with the UPD the appdata… Read more »

Albert
4 years ago

Hi!! Thanks for the script! It is really great! i have been testing it in my environment and it works like a charm. The only drawback that I have, is when I configure O365 MFA on the user account, in my case it starts to send SMS text to the mobile, but is it not possible to bypass this step. I have seen that in the script you have something like “handle MFA in native auth mode” but I tried to put “native” and “ie” in $authodmethod in case to try all possible cases, but unfortunately with the same result.… Read more »

Alan
Alan
4 years ago

For those with a 224 error regarding access denied, I was able to solve my issue by updating my ADFS configuration to set persistent cookies which are required by WebDav per this article: https://blogs.technet.microsoft.com/sposupport/2017/09/16/cookie-persistence-in-sharepoint-online/

Chris L-M
Chris L-M
5 years ago

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 »

Sam
Sam
5 years ago

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 »

Vrajes
Vrajes
3 years ago

Thanks for the amazing script.. We are running into issue where your script is not working few Machins(Citrix VDI) . Looking forward for your help in fixing this issue . 1 . If i map drive URL via Net use fails 2. Use run command \\Path\\ works fine 3. If i map drive via Computer–>Map drive fails 02/14/2019 00:59:03 | INFO | Mapping target: \\XXXXXXXX.sharepoint.com@SSL\DavWWWRoot\personal\username_net\Documents 02/14/2019 00:59:04 | ERROR | ERROR: detected string error 67 in return code of net use command, this usually means the WebClient isn’t running 02/14/2019 00:59:04 | ERROR | failed to contact O: after mapping… Read more »

Andy
Andy
4 years ago

The script has and is working perfectly. Thanks Jos. However we have had OneDrive drops. This seems to be related to the cookie being deleted \ dropping. When this happens we get the trusted sites error. Running the script fixes until the cookie drops again. Anyone else getting this? We are on W10 various builds.

Dennis
Dennis
8 months ago

Hi, we are also testing the script but are receiving
—————————————————————-
“ERROR | Failed to browse to the Office 365 Sign in page, this is a fatal error Exception calling “GoToUrl” with “1” argument(s): “The HTTP request to the remote WebDriver server for URL http://localhost:60451/session/f37fe94c560bff82d4812ca5d9f5ecdd/url timed out after 60 seconds.”
xception calling “GoToUrl” with “1” argument(s): “The HTTP request to the remote WebDriver server for URL http://localhost:60451/session/f37fe94c560bff82d4812ca5d9f5ecdd/url
—————————————————————-
If we try to browse to the O365 Sign in page manually, everything is working fine. Any Ideas

Jason
Jason
4 years ago

We’re getting this error now

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.

We have the sites added to trusted sites and ave for a while.

We recently updated to Windows 10 1709 could that be a factor?

Adam Huszar
7 months ago

OneDrive mapper v5 can work under Server2012r2, if you start from a shared network path, and let domain users to write data there.

John
John
4 years ago

I have been using your script for months and only occasionally does it stop working usually there is a later version which fixes it for us but this time we are on the latest so am after a bit of help with the errors, I have been through the FAQ and nothing has helped solve it. To note nothing has changed on our network since it was last working to now so no updates to clients no policy changes no adfs changes etc. through the appdata log these are our errors. ERROR | IE Zone 3 protectedmode is enabled through… Read more »

trackback

[…] OneDriveMapper […]

Emil Sandberg Lyngved
5 years ago

Having an issue with a new user, all the other users work fine, but this one does not. we are using version 3.0.8 — after a lot of retries and after entering the passord, a box pops up saying: “Mapping cannot continue because we cannot detect your username”. and also the script itself is reporting in red: ERROR: Failed to find the correct controls at (customers site) to log in by the script. The element cred_keep_me_signed_in_checkbox was not found (2) or had no tagName. what could be the problem? the only user it doesnt work for is this one, and… Read more »

Kevin De Schrijver
Kevin De Schrijver
5 years ago

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

Joe Morrow
Joe Morrow
1 month ago

I am working on getting my users up and going on version v5.10. The script works for me, but I have some concerns about the MSEdge Windows opening and closing. I am afraid that my users will close the Windows as they can be impatient at times. Is there a way hide the MSEdge windows opening?

Jesse
Jesse
2 months ago

Hi Jos, after last weekend our version 3.12 script stopped functioning. I was working on updating our system to use v5.10 but I can’t seem to get it to work. When the script launches, MSEdge opens with google.com in an app window (without an address bar) and it hangs here and does not succeed. I have tried different versions of the WebDriver.dll and this seems to change the behavior but it still does not work. Do you have any ideas about what I could be missing? The error log is: ERROR | Failed to load Edge driver, cannot continue. error details:… Read more »

Tommy
Tommy
2 years ago

Anyone else getting error 59 or 53 the last few weeks?
Microsoft must have limited something after the huge increase in Teams usage.

sven
sven
2 years ago

Hi all
OneDriveMapper cann login with sso, see the website goes open and i see my files but the this error apears :failed to contact X: after mapping it to \\ourtenant-my.sharepoint.com@SSL\xxxx_xxxxx_xxxxx_xx\Documents, check if the URL is valid. Error:
Systemfailure 224 add to trusted sites. But when i check via PS all sites are in the trusted zone. Any Idea?
Thanks Sven

Ben
Ben
3 years ago

Thought I’d just mentioned that I’m redirecting the desktop, but instead of using the restart explorer function, I’m issuing a refresh of the desktop.

code:
Add-Type -MemberDefinition $code -Namespace WinAPI -Name Explorer
[WinAPI.Explorer]::Refresh()

It works reliably and is a nicer experience than restarting explorer.

SThurston
SThurston
3 years ago

We successfully mapped drive using the $adsfSmartLink setting set to “https://login.microsoftonline.com/login.srf?wa=wsignin1.0&whr=my.company.domain&wreply=https://mycomp-my.sharepoint.com&LoginOptions=1” where my.company.domain and mycomp are replaced with your values. I had been unable to map it before as I was never getting the Stay Signed In box in the browser.

Pradzy
Pradzy
4 years ago

Here is a good bat code to use to execute the PS1 script for the above mapper

@echo off
net use x: /del
PowerShell -NoProfile -ExecutionPolicy Bypass -Command “yourpath\OneDriveMapper.ps1”

Emalf13
Emalf13
4 years ago

Great work with this. Thanks.

I have gotten version 3.14 working. Much faster and smoother than 3.13.

However, I am having issues with the Folder Redirection. All work except for the Downloads folder. This keeps insisting on redirecting to the local PC. The downloads folder in the registry is named the same as the SID {374DE290-123F-4565-9164-39C4925E467B} rather than Downloads or MyDownloads. This is present in the GUID’s ($KnownFolders), and ‘Downloads’ is in Set-KnownFolderPath. But NOT in Get-KnownFolderPath. I have tried adding this as Downloads and the SID’s but to no avail.

Any ideas please?

Mike
Mike
4 years ago

Recently we have been getting error 224 out of nowhere. we haven’t made any changes to IE or the settings. We do manage IE settings via group policy but I cannot seem to find what the “misconfiguration” is. I tried to reset IE and still no luck. Any help would be greatly appreciated!

ERROR: detected string error 224 in return code of net use command, this usually means your trusted sites are misconfigured or KB2846960 is missing or Internet Explorer needs a reset

Simon
Simon
5 years ago

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
Handun
5 years ago

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
Mickael Selander
5 years ago

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?

Tom
Tom
5 years ago

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
5 years ago

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?

Kevin De Schrijver
Kevin De Schrijver
5 years ago

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

trackback

[…] OneDriveMapper […]

Márton Bacsó
Márton Bacsó
5 years ago

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
Trond
5 years ago

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.… Read more »

Zenna Willemsen
Zenna Willemsen
11 days ago

Hello everyone, I have an issue with the latest Onedrivemapper version. Users in our tenant are not allowed to install the latest edge driver. This is what I can find in the logfile: 09/15/2022 09:31:35 | ERROR | Failed to load Edge driver, cannot continue. error details: Cannot remove item C:\Program Files (x86)\Scripts\OneDriveMapper\Driver_Notes\credits.html: Toegang tot het pad is geweigerd. Currently we have a workarround for this problem as we manually update te Edge driver. However since Edge often get updates we want this option to work so the script automatically get the right version. We don’t want to change the permissions… Read more »

Onedrivemapper foutmelding.png
Mike Hussey
12 days ago

Having two serperate issues on differnet machines – i have successfully mapped two multiple machines but a handful of machines are displaying different errors 1 attached below, 2 is “failed to browse to the office 365 sign in page, error exception calling ‘gotourl’ with ‘1’ argument: HTTP requests to remote webdriver times out after 60 seconds” – Previously using V3 currently using V5

v5 Issue 2.png
Ricardo Fonseca
Ricardo Fonseca
21 days ago

When i run the script appear everytime this error

You cannot call a method on a null-valued expression.
At \\xxx\OneDriveMapper511.ps1:507 char:12
+     if($url.StartsWith($item)){
+      ~~~~~~~~~~~~~~~~~~~~~~
  + CategoryInfo     : InvalidOperation: (:) [], RuntimeException
  + FullyQualifiedErrorId : InvokeMethodOnNull

FAVIER JOEL
FAVIER JOEL
26 days ago

Thank you A LOT for this script !

Nick
Nick
1 month ago

When running the v5 version we receive the following. Edge starts with a brower without searchbar then stops. ERROR | Failed to load Edge driver, cannot continue. error details: Exception calling “.ctor” with “2” argument(s): “invalid argument: user data directory is already in use, please specify a unique value for –user-data-dir argument, or don’t use –user-data-dir” ERROR | Failed to browse to the Office 365 Sign in page, this is a fatal error You cannot call a method on a null-valued expression. (we are updating because v4.11 has the following: Mapping cannot continue because we could not log in to Office… Read more »

trackback

[…] Voici une l’alternative que j’utilise souvent en entreprise qui permettra de mapper des lecteurs réseaux et plus:https://www.lieben.nu/liebensraum/onedrivemapper/ […]

A.D.
A.D.
1 month ago

Just a small modification to your OneDriveMapper v.5.10:
I have added “$global:edgeOptions.addArguments(“headless”)” – in my environment it hides the window and resolves the to-do item that was left without throwing any errors.

Ted
Ted
1 month ago

Log files shows that drive maped correctly yet does not show up.

08/17/2022 07:46:10 | INFO | J: mapped successfully

The only error in log is below

08/17/2022 07:46:01 | ERROR | Failed to cache Edge Window Handles Cannot bind argument to parameter ‘Id’ because it is null.

Only happens to 2 users out of 40 mapped. Concern as both were just recently

Fabrice Paccou
Fabrice Paccou
1 month ago

With the version 3.21, I was able to map a drive letter and access to all my favorites sharepoint site. However, now we must use the latest version since something seem to have change on Microsoft side last weekend I guess. I am trying to configure this way. However, it give me error : ERROR | failed to add network location: Error while creating shortcut @ “R:\Teams\target.lnk”. Check your access and permissions Here’s what I configured in the section starting at line #34 {“displayName”=”Teams”;”targetLocationType”=”converged”;”targetLocationPath”=”R:”;”sourceLocationPath”=”https://TENANTNAME.sharepoint.com/_layouts/15/sharepoint.aspx?v=following”;”mapOnlyForSpecificGroup”=””} Does someone has been able to map a drive directly to access to all favorites ?… Read more »

James Barker
James Barker
1 month ago

We have been using OneDrive Mapper for the past Five Years, so thank you very much.

We are now using Version 5 and mapping Sharepoint Sites & Onedrive,

Unfortunately we have an issue the script sometimes fails to connect, We launch the script using a shortcut via the start menu.

If we then run the shortcut again manually it maps the drives !!!

This is very frustrating as we cannot find the issue..

Elton Farias
Elton Farias
1 month ago

Friend I need your help.
In version 5, how do I bypass the call to test connection (AuthCheck() function) and only load the OneDrive authentication screen?

The idea is to call the OneDrive authentication screen directly as the first call ok.

Last edited 1 month ago by Elton Farias
Creak
Creak
2 months ago

Hi Jos, we are testing v5.10 but it seems like it requires users to sign in to Microsoft accounts with their e-mail and password. It’s not an issue with v3 as OneDrive can be mapped automatically without sinning in. 

Kaushik Patel
Kaushik Patel
2 months ago

Hi, im getting the following below, even tho nothing has changed from trusted sites and KB i have also done a IE Reset too This is using 4.08 can you please advise what shall i do next 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 or Internet Explorer needs a reset ERROR | failed to contact X: after mapping it to \\*-my.sharepoint.com@SSL\DavWWWRoot\personal\*_*_*_*_*\Documents, check if the URL is valid. Error: Access Denied. Before opening files in this location, you must first add the… Read more »

Mike
Mike
2 months ago

We were unable to get v5.10 of the script to work due to this error: You cannot call a method on a null-valued expression”.

As a workaround we are trying to v4.08 script. This appears to work ok, but we get the following error:

convertfrom-json : Invalid JSON primitive: ul.
At C:\Program Files\SharePointDriveMapper\SharePointDriveMapELP1-4.08.ps1:1486 char:115
+ … artJson,($endJson-$startJson-4)).Replace(‘\”‘,'”‘) | convertfrom-json
+                             ~~~~~~~~~~~~~~~~
  + CategoryInfo     : NotSpecified: (:) [ConvertFrom-Json], ArgumentException
  + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromJsonCommand

mark
mark
2 months ago

Hi Jos, Mark here again with a different issue that just appeared today. We’ve been using 3.19 on servers with native auth. It’s been working great for years now. Suddenly, today we are getting errors on numerous servers either asking for passwords or failing with the error ‘cant logon to office 365’. We get this error: ERROR | Unable to find user realm due to Exception calling “GetResponse” with “0” argument(s): “The remote server returned an error: ( 403) Forbidden.” ERROR | fallback mode is enabled, and login failed. Attempting IE auth mode… Then it fails on the IE auth… Read more »

Mike
Mike
2 months ago

Trying to use the 5.10 version of the OneDrive Mapper and getting the following errors. Any help would be greatly appreciated: Unable to connect to the remote server ERROR | Failed to load Edge driver, cannot continue. error details: Exception calling “.ctor” with “2” argument(s): “Cannot start the driver service on http://localhost:30178/” You cannot call a method on a null-valued expression. At C:\Program Files\OneDriveMapper\OneDriveMapper.ps1:629 char:5 +   $global:edgeDriver.Quit() +   ~~~~~~~~~~~~~~~~~~~~~~~~~   + CategoryInfo     : InvalidOperation: (:) [], RuntimeException   + FullyQualifiedErrorId : InvokeMethodOnNull   ERROR | Failed to cache Edge Window Handles Cannot bind argument to parameter ‘Id’ because it is null. ERROR | Failed to browse… Read more »

Adrien
Adrien
2 months ago

hello,
We have implemented version 5 of Onedrive mapper on our IT equipment.
The problem is that on 3 PCs, we have the onedrive mapper script which restarts in a loop. do you have an idea?
Thanks

Martin Curtsen
Martin Curtsen
3 months ago

i’ve got an issue with version 5.10
i get his error
 Failed to set a cookie: Exception calling “SetWinINETCookieString” with “3” argument(s): “Exception setting cookie: Win32 Error code=4317”

Alfredinho
Alfredinho
4 months ago

I get the following error.

System.Management.Automation.RemoteException
ERROR | autoRemapMethod is set to Path, but all mappings failed, OnedriveMapper will exit

The mapping works on all workstations except 1.

René
René
5 months ago

Hallo Jos,
i have a problem with v4.07.
it runs and it connect the drives and then its done and works. but then the script is going to run again and again and again. v3 did not had this do you know what it could be?

Ted
Ted
7 months ago

Newest version works on 10, have issues with 11 as get this error

Downloading latest version from https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/97.0.1072.76 98.0.1108.43/edgedriver_win64.zip to C:\Program Files (x86)\********\****** and ***Program Directory*** ( edited for privacy)
02/24/2022 12:24:51 | ERROR | Failed to load Edge driver, cannot continue. error details: BlobNotFoundThe specified blob does not exist.
RequestId:d565d71b-201e-00d8-05ab-294ad3000000

Something need to change? ( prefer not to stop Edge update)

Martin Curtsen
Martin Curtsen
7 months ago

the autoupdate i 5.8 fails with this message

Failed to load Edge driver, cannot continue. error details: Exception calling “.ctor” with “2” argument(s): “session not created: This version of MSEdgeDriver only supports MSEdge version 96
Current browser version is 98.0.1108.50 with binary path C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe (SessionNotCreated)”

If i download and install the latest version maually everything works again

Julien
Julien
9 months ago

Hello Jos, it seems that there is a download size limit of 5Mb on the sharepoint drive if we want to copy files locally. Is there a way to modify this limit ?

Thanks a lot.

Jonathan
Jonathan
9 months ago

Hi,
I can’t seem to run this script without admin rights. As an admin it works like a charm.
Which access does a normal user need to have, in order to get this script run?

xbonet
xbonet
11 months ago

Hello,

We were using the script and it does the job perfectly. But a couple days ago, we enabled the “Windows Authentication” in our ADFS and now we get an error similar to “failed to contact S:\ after mapping it to \\companyname.sharepoint.com….” and the drives are not mapped.

We tried disabling that feature during a few minutes and it worked again. Any tips?

Greetings!

shawn
shawn
11 months ago

Hello, when we use the v5 script in our logon process, the users see two instances of Edge starting and closing. Is this expected behavior? If so, is there a way we can hide that from the users?

Mon Sam
Mon Sam
11 months ago

Thank you for the script. While the script works perfectly fine behind a firewall, when executed externally I am faced with a problem where the script stops and shows that it is “Attempting to detect username at https://login.microsoftonline.com/login.srf?msafed=0“. I found that if I do a “runas” and then enter my credentials the script will then successfully map my drive.

i.e.  runas /user:texas\<username> notepad

While I do not believe it has to do anything your script, whereas it may be something with my Azure setup, I was curious if you have encountered such issue.

Andy
Andy
1 year ago

Hi Jos just updated to 5.07 and I’m on msedge 93.0.961.52 but get the follwoing error…

INFO | Edge driver present and not blocked by zoning, loading…
ERROR | Failed to load Edge driver, cannot continue. error details: Exception calling “.ctor” with “2” argument(s): “unknown error: MSEdge failed to start: crashed.
 (chrome not reachable)
 (The process started from msedge location C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe is no longer running, so MSEdgeDriver is assuming that MSEdge has crashed.)”

trackback

[…] OneDriveMapper […]

Márton Bacsó
Márton Bacsó
1 year ago

msedgedriver.exe is updated, the old one no longer works with the newest MS Edge.

mark
mark
1 year ago

Hi Jos,

Just started getting this error when Edge updated to version 93.

ERROR | Failed to load Edge driver, cannot continue. error details: Exception calling “.ctor” with “1” argument(s): “session not created: This version of MSEdgeDriver only supports MSEdge version 91
Current browser version is 93.0.961.38 with binary path C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe (SessionNotCreated)”

Is there another Edge driver out there that can be automatically downloaded?

Jess
Jess
1 year ago

Hi Josh,

First of all thanks for this amazing script, I was able to map our user’s onedrive in Citrix. It worked great for the past years but stopped maybe 2-weeks ago and can’t figure out the problem. It’s throwing the error below. Any idea why we’re getting this?

ERROR | Failed to retrieve cookie for Onedrive for Business: Exception calling “GetResponse” with “0” argument(s): “The
remote server returned an error: (308).”
ERROR | Problem reported during step 2: no request given

Exception calling “GetResponse” with “0” argument(s): “The remote server returned an error: (308).”

Nico
Nico
1 year ago

Hi, We’ve been encountering some issues with V4 of the script. Sometimes the pop up says ‘Done’ however the converged drive has no links to Sharepoint in them. Just a blanked map drive, this happens sometimes but not always. We’ve since moved over to new V5 script which replaces IE with Edge and I am now encountering the same problem but it happens all the time. The log reports the following: 07/26/2021 14:42:47 | ERROR | Failed to load Edge driver, cannot continue. error details: Exception calling “.ctor” with “1” argument(s): “Cannot start the driver service on http://localhost:50241/” We’re running the… Read more »

Ricardo Fonseca
Ricardo Fonseca
1 year ago

I cannot run OneDriveMapper 5.0 on remnote drive.

the script download files correctly but not run

06/29/2021 10:34:05 | ERROR | Failed to load Edge driver, cannot continue. error details: Exception calling “CreateDefaultService” with “2” argument(s): “The file Microsoft.PowerShell.Core\FileSystem::\\DOMAIN\msedgedriver.exe does not exist. The driver can be downloaded at http://go.microsoft.com/fwlink/?LinkId=619687

Joe
Joe
1 year ago

V5 is giving following error: (Is that a know issue?)

ERROR | Failed to load Edge driver, cannot continue. error details: Method invocation failed because [OpenQA.Selenium.E
dge.EdgeDriver] does not contain a method named ‘new’.

Eric
Eric
1 year ago

Hi, we have been relying on this awesome script for some time for citrix environment. As we know Microsoft mentioned that start from beginning August 17, 2021, the remaining Microsoft 365 apps and services will no longer support IE 11 (https://techcommunity.microsoft.com/t5/microsoft-365-blog/microsoft-365-apps-say-farewell-to-internet-explorer-11-and/ba-p/1591666). Should it affect this script functionality ?

Reece
Reece
1 year ago

Hi, Upgrading to the v4 script. Trying it out on a SSO account and an account that has been signed in not using SSO, keep getting the message ‘attempting to detect username – url – waited for x seconds’ then a line after you’re already logged in. This repeats then a box appears, we can’t detect your username thanks for any help INFO | —–04/21/2021 09:23:04 OneDriveMapper v4.07 – starting—– INFO | Script elevation level: User INFO | Set TLS protocol version to prefer v1.2 INFO | You are rholland running on Windows 10 with IE 11 and Powershell version… Read more »

Last edited 1 year ago by Reece
Simon
Simon
1 year ago

Hi I am running into some problems with the script. Previously it worked just fine, but recently it stopped working. When running the script, everything works fine right until you are prompted for a login. After entering my credentials, it just logs in to SharePoint and never closes the IE window. Log: 04/20/2021 09:10:07 | INFO | Script elevation level: User 04/20/2021 09:10:07 | INFO | Set TLS protocol version to prefer v1.2 04/20/2021 09:10:07 | INFO | You are sv running on Windows 10 with IE 11 and Powershell version 5 04/20/2021 09:10:07 | INFO | loading interop service… Read more »

Giovanni
Giovanni
1 year ago

How can I prevent the authentication dialog from appearing if my credentials are safely stored in Credential Manager and I want to use the modul Credential manager?

Tom
Tom
1 year ago

Hi

I am having some problems with Azure AD connect SSO.

The SSO is working, but the drive doesn’t map and I get the 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 or Internet Explorer needs a reset’.

I have checked the Internet Explorer settings and all the sharepoint.com domains are in trusted sites.

Any help would be greatly appreciated.

Thanks

Adrien
Adrien
1 year ago

Hello
I am trying to switch from version 3 to version 4 of onedrive mapper
I activated the $ useAzAdConnectSSO but I have the popup to identify myself.
There is Internet Explorer on PCs.
Do you have an idea ?
Thank you

Jonas Hellström
Jonas Hellström
1 year ago

Has anyone tried this with Azure Seamless SSO?

We can’t get it to work.

martin
1 year ago

After the lastest update to Edge, the script open edge insted of ie and then it fails
i found a workaround by disabeling ie to open edge, but not the perfect solution

will there be an update to the scipt ?

Nard
Nard
1 year ago

Hi Jos,
Are you planning to change Onedrivemapper to continue working after 27-08-2021, when M365 websites stop supporting IE11?

Maikel van der Heyden
Maikel van der Heyden
1 year ago

Hello i have an issue, we use the onedrivemapper but we have in shared documents double space and singel spaces, is there some way to get both of them in the converged drive, i hope you could help me.

it works only now when i choose 1 of it: with double or singel spaces

Ralph Montgomery
1 year ago

Good Day! We have been using v3.20 successfully for about a year. We are not attempting to transition to v4, but any converged SharePoint mappings are unclickable (links do not work). v3.2, we do not have this issue, only with v4.0.

Any thoughts?

Screen Shot 2021-01-11 at 17.34.19.png
Sebastian
Sebastian
1 year ago

Hello everybody,

I use version 4.07 in an RDS-Farm with 4 servers and UserProfileDisks. I only use the function of integrating a Sharepoint as a drive with a letter. However, each time the user logs on to the RDS-Farm, they are asked for a password when the script runs.

What i have already done is to specify the sharepoint site as a trusted site and also tried the KB943280 to solve the problem.

Scott
Scott
1 year ago

Started to receive the following error. “check if the URL is valid. Error: System.Management.Automation.RemoteException System error 59 has occurred. System.Management.Automation.RemoteException An unexpected network error occurred. System.Management.Automation.RemoteException”.

I am using v3.21, which has worked flawlessly until today. I have not applied any windows updates or changed GPO settings.

To try to remedy, I have tried to use v4.07, but it says that I’m already logged in (doesn’t prompt me for password) and still gives me the same exact error. What should I look for? I have removed all cache, cleared cookies.

Johnmy Rivera
Johnmy Rivera
1 year ago

How do I get the script to only map the drive if the user is part of the target security group?

Right now the script maps all the sites under desired mappings.

Ralph Montgomery
1 year ago

Love the script; using the lightweight version (4.07) appears to have solved the issue of mapping an F3 user’s OneDrive, but has dropped support for automapping the Teams/SharePoint Favorites functionality (present in v3.20); something we would like to pursue. What functions can we pull back into a customized version to add that back?

Karen
1 year ago

Hi,
Version 4 on Domain Joined devices not recognizing User UPN and asking to login everytime when startup scrip runs.

For old version scrip $userLookupMode = 4 works without login process.

Any idea how we can add $userLookupMode = 4 on V4 script ?

Robert
Robert
1 year ago

I’m trying to use the 4.0.7 version. It’s working only i have the problem with automatic connect all my favorite teams. It wont work what i’m trying. Is there someone with a solution? Its about 3000 teams for different users.

mikel
mikel
1 year ago

Hi! I am getting the 224 error. I followed some advices in previous comments but I can’t manage to solve the problem. This is the log. Thanks in advance!!! 10/07/2020 17:28:26 | INFO | —–10/07/2020 17:28:26 OneDriveMapper v4.02 – user on SKV00021 starting—– 10/07/2020 17:28:26 | INFO | Script elevation level: User 10/07/2020 17:28:26 | INFO | Set TLS protocol version to prefer v1.2 10/07/2020 17:28:26 | INFO | You are user running on Windows 10 with IE 11 and Powershell version 5 10/07/2020 17:28:28 | INFO | NOTICE: IE Security zones ambiguous – checking both computer and user 10/07/2020… Read more »

Kaushik Patel
Kaushik Patel
1 year ago

Hi All,

Im getting the following error
Error deteched while following fmHF redirect, check the FAQ for help
fallback mode is enabled, and login failed. attempting IE auth mode…

does anyone know how to fix this.

jay
jay
1 year ago

It mapped the drive for me. I got to the point where it says “sleeping for 39 seconds”. It froze after that.
It also says “autoprotectmode is set to true, reverting to old settings” not sure what that means. Is it going to reset my KFM settings? I have my Documents, Pictures and Desktop syncing to OneDrive.

Last edited 1 year ago by jay
martin
2 years ago

i’ve got some problems since monday
the mapped drives look empty
if we update the folder it sometimes comes back
the folder are also working extremly slow

RICHIOUD
RICHIOUD
2 years ago

Hello Jos,

This day i speak with Microsoft about slowness and problem with displaying Folders and Files in mapped drives. They said me : “IE will be shut down on November 30”, after that can we continue to use mapped drives ?

Cordially,

RICHIOUD Jérémy

AEmberson
AEmberson
2 years ago

New version 4.3 the first time is asking my users to sign in via the internet and brining up the MS sign in page. Never used to do this with V3. Any ideas?

Joshua
Joshua
2 years ago

Hi Jos,

First of all, thank you so much! This script is amazing! It is working with Server 2019 with Citrix 2006 MSC. You are the best!

DawnM
DawnM
2 years ago

I recently mapped my OneDrive using the latest, v4, of the mapper. Now when I try to refresh in IE, it’s not refreshing the mapped folder in File Explorer. I still get the “an error occurred while reconnecting…” message. I didn’t have an issue with refreshing through IE when an older version of the mapping script had been used. How can I resolve this without re-mapping my drive every time it disconnects? Thanks.

Massimo
Massimo
2 years ago

Does version 4 works if Internet Explorer is not installed?

Version 3 did, but now I get the error “Mapping cannot continue because we could not start your browser”

OnedrivemapperErrorNoIE.png

Microsoft 365, Azure, Automation & Code

2.3K
0
Would love your thoughts, please comment.x
()
x