OneDriveMapper

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

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

What does it do?

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

Requirements

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

Recommendations

How to install

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

OnedriveMapper Cloud

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

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

Limitations

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

Disclaimer

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

Changelog

FAQ

 

 

Leave a Reply

1289 Comments on "OneDriveMapper"

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

[…] OneDriveMapper […]

Tom
Guest

Hi Jos

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

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

Thanks

Luke
Guest

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

Is anybody else getting this?

Peter H
Guest

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

Aart
Guest

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

Kevin De Schrijver
Guest

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

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

I also have the same issue.

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

Kevin De Schrijver
Guest

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

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

trackback

[…] OneDriveMapper […]

Márton Bacsó
Guest

Dear Jos,

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

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

Your help would be greatly appriciated!

Trond
Guest

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

trackback

[…] OneDriveMapper […]

Peter H
Guest

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

Shane
Guest

Hi Jos,

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

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

instead of Documenten

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

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

[…] OneDriveMapper […]

Don
Guest

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

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

trackback

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

Scott
Guest

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

Nigel
Guest

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

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

Nigel Brown
Guest

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

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

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

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

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

Mark
Guest

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

trackback

[…] OneDriveMapper […]

Blu3s
Guest

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

Blu3s
Guest

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

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

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

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

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

Joe
Guest

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

Jeremiah
Guest

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

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

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

Dwain
Guest

Hi Jos,

Great script!

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

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

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

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

What would be the configuration?

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

But domains are using the same IdP.

Thanks!

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

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

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

Ian
Guest

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

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

Ian
Guest

Found the line :_)

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

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

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

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

Piotr
Guest

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

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

Leah
Guest

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

Piotr
Guest

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

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

Piotr
Guest

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

sjno
Guest

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

Ivan
Guest

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

frank
Guest

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

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

Not sure what i am missing.

trackback

[…] OneDriveMapper […]

adam
Guest

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

Jamie
Guest

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

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

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

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

Hi Jos,

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

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

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

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

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

and it fails to map the drive.

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

Works like a charm, amazing!

Daavid
Guest

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

Stig
Guest

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

Øystein
Guest

Hi Jos,

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

B.r,
Øystein
———–

Tyler
Guest

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

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

Hi Jos

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

Thanks

TechieGuy17
Guest

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

We have users that store their IE favourites in there Onedrive

Rob
Guest

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

Dave
Guest

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

Gary
Guest

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

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

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

Nico
Guest

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

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

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

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

Thanks again as works great.

Mrcs
Guest

This also worked for our environment!

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

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

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

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

Version is: 2.53

Thanks in advance and Kind Regards

Gee
Guest

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

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

Hello Jos,

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

The argument -WindowStyle Hidden is configured in the parameters.

Best regards,

Bas

Steven
Guest

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

On Win10, this error shows up:

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

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

trackback

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

Mark
Guest

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

Stig
Guest

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

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

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

Phil Warren
Guest

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

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

Jos,

We’re having an issue with your script.

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

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

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

Peter
Guest

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

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

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

Any suggestions on what the cause may be?

Bas Peeperkorn
Guest

Great script, but does it support Office 365 Groups libraries?

Phil
Guest

When users are logging on i am getting a warning in the log
01/20/2017 15:08:39 | WARNING | Maximum file upload size is set to 0 MB
Is this a problem and can it be changed. It doesn’t seem to affect anything.

trackback

[…] @artfulmatt – We experimented with this script: OneDriveMapper | Liebensraum It was brilliant when your username and password are the same for your domain and your Office 365 […]

Matt
Guest

Hi Jos, Have you come across a scenario with OneDriveMapper where running the script manualy will connect and map a drive successfully, but when running from a logon script it will fail!. Looking at the logs I can see an error Failed to use Azure AD SSO for workplace joined devices. Its odd I dont get this error when running the script manualy. Any Thoughts or advice would be appreciated.

Jeroen
Guest

Hi Jos, we’ve been having the same problems as Sam. We tried the 2.53 script but that one was also giving inconsistent results.
This morning everything seems to have been mysteriously resolved without any changes on our end. Do you have any information regarding the MS change that made you change the script for 2.53? We suspect that MS made another change to resolve this problem but we can’t find anything other then some mentions on SharePoint blogs.

Jorrit
Guest

Hi Jos,

I keep getting this error:

01/18/2017 10:01:24 | ERROR | failed to contact V: after mapping it to \xxx-my.sharepoint.com@SSLDavWWWRootpersonalxxx_xxxx_nlDocuments, check if the URL is valid. Error:
Systeemfout 224.
Toegang geweigerd. Voordat u bestanden op deze locatie opent, moet u de website eerst toevoegen aan de lijst met vertrouwde websites, naar de website browsen en de optie voor automatisch aanmelden selecteren.

Any hints? I’ve added all the sites to the trusted lists and checked it a 1000 times.

Petr Urbanec
Guest

A have the same problem (but the error message is in the czech language). Using version 2.53. The error occurs at OneDrive mapping. Sharepoint mapping is OK. It’s wierd that it has baceme working after running the 2.49 version. I tried to remove all cookies in the IE11. After that the version 2.53 failed completely including SharePoint (error 224). I tried the version 2.49 then and it was successful.

Ben
Guest
Hi Jos, I’ve downloaded the script (V2.53) and I can’t get it to work. The errors I get are: ERROR | ERROR: WebDav File Locking support is enabled, this could cause files to become locked in your OneDrive or Sharepoint site ERROR | IE Zone 0 protectedmode is enabled through group policy, autoprotectedmode cannot disable it. This will likely cause the script to fail. ERROR | IE Zone 3 protectedmode is enabled through group policy, autoprotectedmode cannot disable it. This will likely cause the script to fail. ERROR | IE Zone 4 protectedmode is enabled through group policy, autoprotectedmode cannot… Read more »
Bawbaw
Guest
Awesome script!! Keep up the great work! Its not clear to me how you use this script if you currently have Azure AD Connect SSO Prview enabled on your tenant? If I allow your script to inject the trusted sites required for AACSSO the script will run but the AACSSO will not work for myother office products. If I leave the sites in my GPO and inject them into IT that way then the script fails explicitly. How do we have the AACSSO enabled and simply login to your script since it seems it will not allow autologin if AACSSO… Read more »
trackback

[…] OneDriveMapper […]

JBE
Guest

How come users with the mapping only have 69,5 GB while 1TB is licensed?

Marco
Guest

Scripts works great! Only we’re using V2.52 on a Windows 2008R2 Citrix farm, Office 365 without ADFS. We’re having problems when a user changes it’s password, OneDriveMapper.tmp is persistent. Obviously we could let them logon every day by setting it to $Null, but that is not very convenient either. Do you have any other solution for this? Thanks a lot!

Paul Szatkowski
Guest
First of all – great script. Thanks so much for your work on this. I’ve got an issue at a site and I’m not entirely sure how to deal with it. We enforce AppLocker to prevent any executables or scripts running from user-writeable locations (mainly to prevent CryptoLocker). This seems to be causing issues with the script. Having had a brief look I suspect it’s where the C# is being compiled and executed. It seems to generate a randomly names PS1 and PSM1 file in the users local temp folder. Is there any way we can either force a fixed… Read more »
bashr
Guest
Hello, thanks for your great work! should the script run on windows server 2008 version 6.1? I get following error: INFO | Login attempt at Office 365 signin page ERROR | failed to use Azure AD SSO for Workplace Joined devices INFO | Failed to find signin element type 1 on Office 365 login page, trying next method. Error details: Cannot find an overload for “getElementById” and the argument count: “1”. INFO | Failed to find signin element type 2 on Office 365 login page, trying next method. Error details: Cannot find an overload for “getElementById” and the argument count:… Read more »
Thomas
Guest

Hi, This looks like the answer I have been trying to find. My issue is that I have configured the script for my school email and o365 tenant, it all seems to work with no errors. I have also added all domains to be trusted and followed the config steps to ensure the script can run and I have full permissions.
However, I have turned on debug mode and still no log file is being created. No drives are being mapped either.
I am using Window 10 insider and have also tried to run on another client windows 10 1607.
Any ideas.

RJE
Guest
I’m having problems with version from 2.47 through to 2.51. Machines are Windows 10 Azure AD joined devices, attempting to use SSO. This configuration was previously working fine but now generates an error message: 01/09/2017 12:28:39 | INFO | Failed to find signin element type 1 on Office 365 login page, trying next method. Error details: Exception from HRESULT: 0x800A01B6 01/09/2017 12:28:39 | INFO | Failed to find signin element type 2 on Office 365 login page, trying next method. Error details: Exception from HRESULT: 0x800A01B6 01/09/2017 12:28:39 | ERROR | Failed to find signin element type 3 on Office… Read more »
Márton Bacsó
Guest
Dear Jos, 2.49 works fine, but I have problems with 2.50 and 2.51. I get two error messages at the end of the login process. “Failed to find signin element type 3 on Office 365 login page. You may have to upgrade to a later Powershell version or Install Office. Attempting to log in anyway, this will likely fail. Error details: A kivétel HRESULT-értéke: 0x800A01B6” and “Failed to find the correct controls at https://login.microsoftonline.com/login.srf?wa=LONG URL to log in by script, check your browser and proxy settings or check for an update of this script. A kivétel HRESULT-értéke: 0x800A01B6″ I have… Read more »
RJE
Guest
Experiencing a very similar issue here: 01/09/2017 12:28:39 | INFO | Failed to find signin element type 1 on Office 365 login page, trying next method. Error details: Exception from HRESULT: 0x800A01B6 01/09/2017 12:28:39 | INFO | Failed to find signin element type 2 on Office 365 login page, trying next method. Error details: Exception from HRESULT: 0x800A01B6 01/09/2017 12:28:39 | ERROR | Failed to find signin element type 3 on Office 365 login page. You may have to upgrade to a later Powershell version or Install Office. Attempting to log in anyway, this will likely fail. Error details: Exception… Read more »
paul mitchell
Guest
Version 2.51 is working well for me on my test devices, but one user in the field is unable to map a drive, I have attached the log file, can you offer any suggestions? 01/05/2017 10:01:43 | INFO | —–01/05/2017 10:01:43 OneDriveMapper v2.51 – Rob C on ROBCTHINKPAD starting—– 01/05/2017 10:01:43 | INFO | Script elevation level: User 01/05/2017 10:01:44 | INFO | NOTICE: you are running the latest (v2.51) version of OnedriveMapper 01/05/2017 10:01:44 | INFO | You are running on Windows 10 with IE 11 01/05/2017 10:01:46 | INFO | NOTICE: HKLM:SoftwarePoliciesMicrosoftWindowsCurrentVersionInternet SettingsSecurity HKLM only not found in… Read more »
Eddy
Guest
Thank you very much for this script Jos! The script is now failing to map the drives for some, including myself, users. It worked fine until a couple of weeks ago. The error message at the end of the log simply says: Detected user: eddy_guerrero_DOMAIN_org Current location: https://TENANT-my.sharepoint.com/personal/eddy_guerrero_DOMAIN_org/_layouts/15/onedrive.aspx Cookies generated, attempting to map drive(s) Mapping target: \TENANT-my.sharepoint.com@SSLDavWWWRootpersonaleddy_guerrero_DOMAIN_orgDocuments failed to contact H: after mapping it to \TENANT-my.sharepoint.com@SSLDavWWWRootpersonaleddy_guerrero_DOMAIN_orgDocuments, check if the URL is valid. Error: System error 53 has occurred. The network path was not found. I’ve confirmed the actual URL of the ODB library is exactly as listed in the “Current… Read more »
Roberto
Guest

Are we able to change the max sync size limit of 48mb or is that something i would need to change in my tenant?

Satnam
Guest

Hi Jos

We were using v2.49 with no issues on a test workstation and after disconnecting the drive and running v2.50; we are getting an error 224 during the mapping portion.

Any suggestions to resolve?

Thanks so much

bicky
Guest

I was getting exactly same error and Installing the hotfix (https://support.microsoft.com/en-us/kb/2846960) has fixed it.

trackback

[…] OneDriveMapper […]

wpDiscuz