OneDriveMapper

onedrivemapperOneDriveMapper is a free, open source script I wrote which you can use 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 500,000 times, has millions of users 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.

Download open source version:

OnedriveMapper V3 @GitLab

Enterprise alternative (with support & discount):

IAM Cloud Drive Mapper

What does OnedriveMapper do?

  • Runs at logon or on demand (group policy, RES, etc)
  • Maps to Onedrive for Business (with auto detection)
  • Maps to Office 365 Groups (WITH auto detection of groups/teams)
  • Maps to Sharepoint Online
  • No Sync, online WebDav connection over HTTPS
  • 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
  • Can also map based on AD security groups
  • Sets a customizeable label
  • 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 or Citrix Seamless Apps
  • Can redirect OS folders (like My Documents)
  • 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
  • Permission to map drives
  • Permission to launch powershell scripts

Recommendations

How to install

  1. Download the latest version at GitLab
  2. Add https://tenantname-my.sharepoint.com to your Trusted Sites list if mapping to O4B
  3. Add https://tenantname.sharepoint.com to your Trusted Sites list if mapping to Sharepoint Sites, O365 Groups or Microsoft Teams
  4. 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.
  5. Ensure Windows Authentication is enabled in Internet Explorer (this is default) if not using Native Auth
  6. Set $O365CustomerName to your Tenant Name (xxx.onmicrosoft.com)
  7. Set $userLookupMode to what matches your environment
  8. disable file locking
  9. Run it on a representative test machine / user and thoroughly check the log it generates in %APPDATA%
  10. 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

  • MFA support only in Native mode
  • Okta ‘kinda’ works in IE mode, native not supported
  • RMUnify ‘kinda’ works in IE mode, native not supported
  • This script does not work Powershell V2 or lower (comes with Windows 7), install V3 or higher

Disclaimer

I’m not a real programmer, this code is meant as a Proof Of Concept. I do not guarantee this product will work in your setup, and I offer no dedicated support, I try to help everyone on a best-effort basis but also have to work for a living. So make sure you test well and understand the code before you use it. This script may suddenly become obsolete without prior warning when Microsoft changes things. For an enterprise worthy and supported product, I strongly 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

 

 

1797
Leave a Reply

avatar
561 Comment threads
1236 Thread replies
168 Followers
 
Most reacted comment
Hottest comment thread
438 Comment authors
Marc FarmerAdamEddy GjordanJos Recent comment authors

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

  Subscribe  
newest oldest most voted
Notify of
Ian
Guest
Ian

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
Guest

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?

Rick de Vries
Guest
Rick de Vries

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.

Chris L-M
Guest
Chris L-M

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 »

Alan
Guest
Alan

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/

Albert
Guest

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 »

John
Guest
John

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

Sam
Guest
Sam

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 »

Emalf13
Guest
Emalf13

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
Guest
Mike

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

Bjorn
Guest
Bjorn

We are getting the following error since this morning. We have checked the FAQ and did an search on the internet but coudnt find a solution. Can anyone please help? 03/30/2018 08:45:09 | INFO | attempting to trigger a redirect to SSO Provider using method 1 03/30/2018 08:45:13 | INFO | Waited 0 of 10 seconds for SSO redirect. While looking for userNameInput at https://login.microsoftonline.com/login.srf?client-request-id=c97ae724-d1fb-4dac-ba1a-6eb7c9839c1c. If you’re not using SSO this message is expected. —- 03/30/2018 08:45:38 | INFO | Waited 9.5 of 10 seconds for SSO redirect. While looking for userNameInput at https://portal.microsoftonline.com/?wa=wsignin1.0. If you’re not using SSO this… Read more »

Jason
Guest
Jason

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?

Emil Sandberg Lyngved
Guest

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 »

Simon
Guest
Simon

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

Handun
Guest
Handun

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

trackback

[…] OneDriveMapper […]

Mickael Selander
Guest
Mickael Selander

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
Guest
Tom

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?

Kevin De Schrijver
Guest
Kevin De Schrijver

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

Kevin De Schrijver
Guest
Kevin De Schrijver

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
Márton Bacsó

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
Trond

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

Flint
Guest
Flint

Hi Jos,

We moved from ADFS to Azure AD Pass-through SSO and now we get an error during the native method:

ERROR | Unable to find user realm due to Exception calling “GetResponse” with “0” argument(s): “The remote server returned an error: (400) Bad Request.”

I tired different userLookupModes and removed the Azure SSO URLs from our GPO which the log said was not supported but still get the same error.

I can provide more details if necessary, thanks!

Jack
Guest
Jack

Hey Jos! Just wanted to let you know that the script is infinite looping again. Microsoft made another change to the signon experience. Thanks!

Jason
Guest
Jason

I don’t know if anyone else has run into this. We’ve started to look at Multi factor Authentication to Office 365. When I enable that for a user this script pops up and tried over and over and the user gets text messages from MS authentication over and over as its trying. I don’t know that its necessarily a flaw it might not be compatible with MFA.

John
Guest
John

Hi Jos,
I’m putting this into production, thanks for taking the time to create it and put it out there for noob’s like me. I have one question about usage though; I need to have a way for the script to test to see if the logged in user has an AD account in another domain before it runs and exit if they dont. Is there an elegant way to do this using existing credentials stored via the script or am I on my own?

Thanks!

Michiel van Delft
Guest
Michiel van Delft

Hi Jos, Happily using your script for quite a while now, even with bigger (1000+) customers. However, with a new customer I am having some proxy issues. I think I whitelisted and excluded all nessecary URL’s, however, I am getting the following error while mapping: 10/26/2017 15:41:12 | INFO | Retrieving Onedrive for Business cookie step 1… 10/26/2017 15:41:19 | ERROR | Failed to retrieve cookie for Onedrive for Business: Exception calling “GetResponse” with “0” argument(s): “The remote server returned an error: (407) Proxy Authentication Required.” 10/26/2017 15:41:19 | ERROR | Problem reported during step 2: no request given Did… Read more »

Josh
Guest
Josh

how can i make it so it doesnt default to the ADFS username, i want to have it ask for the O364 account name

JamieA
Guest
JamieA

Hi Jos,
I’m trying to get the native method working on Windows 10, but I’m having an issue.
When the script gets to line 1856 (in v3.11), $nextURL is set to -1 which means when line 1896 is reached and JosL-WebRequest is called, the line [System.Net.WebRequest]::Create($url) is trying to create a webrequest using the url -1, which obviously isn’t a valid URL.

René
Guest
René

Hallo Jos, Het script is echt nice en werkt goed. heb alleen 1 probleeem dat het na een tijdje de verbinding verliest met Sharepoint en onedrive. dan krijgen gebruikers er rode kruisen door. je kan de schijven dan weg halen en script opnieuw opstarten en dan werkt het weer of inloggen op scharepoint via IE en dat herstelt de verbinding ook weer. dus erg raar en denk dat het een soort time out als je een bepaalede tijd bent ingelogd ofzo. jij toevallig ervaring mee en weet waar dat aan ligt? allen het script nogmaals uitvoeren zonder de schijven te… Read more »

Jordan Woodward
Guest
Jordan Woodward

Hi,
The script works perfectly on Windows 7, however after testing it out on Windows 10 the drive does not map for some reason. It prompts me for the credentials but does load the drive?

Any help would be appreciated.

Thanks.

Thijs
Guest
Thijs

Hi Jos, in our company we are having problems with the webdav to SharePoint teamsites + OneDrive. Lately we are having the problem that files which are uploaded on the webdav will become ’empty’ as in size 0kb. When opened in Office 365 it will show the document, but when downloading and opening in the local products it will not show the document and give a fault. Can you help us with this problem?

Rob Nicholson
Guest
Rob Nicholson

Wow – just printed the script out to understand how it’s working and 80 pages! Maybe one for tomorrow 🙂

John
Guest
John

Hello everyone and thankyou onedrivemapper script has been brilliant, however for a couple months now it hasn’t been as reliable as it used to be. running when a user logs in in basically doesn’t work at this point anymore and if a user runs in manually it has a higher success rate manually running its works probs 60% of the time. We use adfs single sign on We cannot see anything obvious as to why apart from a couple errors in the script which i cannot see an answer for. the errors we commonly see are ERROR | Error received… Read more »

Eirik
Guest
Eirik

I’m getting the 224 error now, it says:
“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 a
utomatically.”.

I’m using native mode without adfs, so I don’t see why this is happening?

Jordan Woodward
Guest
Jordan Woodward

Hi,

I work in a school and this script is an absolute dream!

It works pretty much perfectly however I cannot get it to SSO as it takes the users log in username but requires the password. Is it possible to take AD credentials for both username and password? We use RM Unify, I have had a look through the script and changed to what is necessary for RM Unify but the password is still required. If we could get this working then this would be amazing.

Any help would be appreciated!

Thanks.

Eirik
Guest
Eirik

Hi, I’m trying to run this script for a colleague using IE function. I keep getting this error: “failed to detect or use logged in Tile in IE: Method invocation failed because [System.__ComObject] does not contain a method named ‘IHTMLDocument3_getElementById’.
This is followed by “Ie login function succeeded”, but that also fails. System error 224: Add it to the safe zone etc. in IE. I have done this. Any idea what could be causing this?

Jose
Guest
Jose

I made the mistake of running the script without changing anything.
can I undo any system changes that have been made?

Ian Wilde
Guest
Ian Wilde

Hi, I wondered if anyone can help. We have the One drive mapping working great using this script (Many thanks). What I am looking for is to create a second one which only runs if a user is a member of a certain security group (Which I am able to do)., then maps a separate sharepoint drive. How could I create the second to not cause issues with the first mapping? I’m having limited success so far in that if the test user logs on again there appears to be issues with the one drive mapping. Many thanks in advance… Read more »

Dave
Guest
Dave

Hi, your script is nothing short of genius. I just had one quick question, how easy/difficult is it to add 2 SharePoint sites to the sharepointmappings variable?

Sean
Guest
Sean

Thanks for the useful script. On one client, I’m receiving a message that states “Mapping cannot continue because we could not log in to Office 365”. I’ve verified the credentials are correct and that I can login to Office365 manually with no issues. I’ve tried removing the .tmp files where the creds are stored and reentering them but still receive the same message.

Any help is much appreciated.

Eirik
Guest
Eirik

Hi, I have a problem where I am asked for password. If I enter the wrong password 3 times in a row, it still maps the drive successfully via IE function, and then incorrectly shows a message saying that the mapping cannot continue. Any way to fix this? I don’t want users typing in a random password getting access.

Henrik Skovgaard
Guest

I am getting an error saying:
ERROR | ERROR: Failed to set test cookie, script will fail: Exception calling “SetWinINETCookieString” with “3” argument
(s): “Exception setting cookie: Win32 Error code=2”

and then later in the output, I see this one:
“ERROR | ERROR: detected string error 224 in return code of net use command”

I have tried both v3.10 and v3.11 with same result.

Sam
Guest
Sam

Hey Jos, Thanks for that great Script which works just fine in GermanCloud until I enable MFA for a user. I can’t figure out what the problem is. Do you have any hint for me what to analyse?

Evan Riser
Guest
Evan Riser

Great tool! Where do we stand on MFA support?

Gfelli
Guest

Hi Jos, don’t know if someone else has tried. I have change all .com to .de in the script for a customer and now he is using the script with a DE-Trustee O365 tenant… Just to let you know.

Bas Peeperkorn
Guest
Bas Peeperkorn

Hi Jos, great script and using it for some time now.

But how can i manage to create one script that creates a Drive for my current company and a Drive for my external company. My Office 365 account has external rights for the other company.

Thanks in advance!

Lee
Guest
Lee

Thanks for the great script Jos – came across an interesting issue recently that may interest you. Client moved from on-premise server to Azure server for terminal services and as such went from an on-premise AD environment to complete Azure AD structure. Whilst OneDriveMapper worked fine when Azure AD Connect was in use and SSSO enabled, once AADC was disabled the scripts login began intermittently failing on the Azure AD server. I found that disabling AADC was not sufficient to also disable SSO or to prevent its use, and as such your script by default would detect SSO as enabled… Read more »

Lee Chance
Guest

Greetings. I have been tested this for my company to move personal(P) drivers to one drive for business. I have found I cannot move a file larger that about 315 megs without getting an error. Anything below that in size seems to work. It also seems like I can pull any file from the mapped network drive to my local drive of the same size without getting an error. Moving to local also gives me a security prompt as well. Any Ideas on how to fix this. I have changed all webclient settings in registry to max.

trackback

[…] and we might find that this particular issue is resolved. We used this for the file migration: OneDriveMapper | Liebensraum I think you're correct on WebDav and SharePoint being the issues rather than specifically CDM. I […]

Scott Adams
Guest
Scott Adams

Getting error 53 on clients that are RDP’ing into Server 2012 and Server 2016.

The script works flawlessly on clients logging into Windows 7, Windows 10, and RDP’ing into Server 2008 R2.

Thoughts?

I do not see a “trailing /” in my script.

trackback

[…] Posted by snagrat Can I ask how you are redirecting My Docs to OneDrive? Take a look at this OneDriveMapper | Liebensraum if you are after a free solution or want something to test with a small group of users before […]

Jason Komendat
Guest
Jason Komendat

Jos, we’ve been using your script for sometime now and its great. I was wondering if you could help us with an issue on a few PC’s it just doesn’t work. i was going to just reimage them but everything else works on them but this the drive doesn’t map

08/30/2017 07:56:58 | ERROR | failed to contact U: after mapping it to \\crdistrict-my.sharepoint.com@SSL\DavWWWRoot\personal\24jmullett_cr_k12_ia_us\Documents, check if the URL is valid. Error:
The network path was not found.

System error 53 has occurred.
The network path was not found.

Sol
Guest
Sol

I have been using this powershell script for sometime and its great, I always update to the latest version. One issue we have come across is that the script does not put Internet Options zones back to protected mode. This causes issues with some outlook addins, the new onedrive sharing and skype logins. Skype just says that javascript needs to be enabled. The onedrive sharing just keeps on loading and loading. outlook addins needs to have restricted zone as protected mode. Resetting the internet options work, we are looking into creating a powershell script to enable those after this onedrivemapper… Read more »

Hasan
Guest
Hasan

We are in the process of locking down TLS 1.0 on our firewall and notice that OnedriveMapper v3.09 is connecting using TLS 1.0 instead of TLS 1.2 Is there a way I can force it to connect using the newer TLS version?

trackback

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

Ronald
Guest
Ronald

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

Eugene
Guest
Eugene

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

Buster
Guest
Buster

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

Andrew
Guest
Andrew

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

Andy Harper
Guest

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

L_D
Guest
L_D

Hi there

These are my PS messages

“Logged into Office 365!”

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

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

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

rashannw
Guest
rashannw

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

trackback

[…] OneDriveMapper […]

Notty
Guest
Notty

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

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

bashr
Guest
bashr

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

Mark C
Guest
Mark C

Hello Jos,

Awesome script by the way just have a quick question.

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

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

Any comments will be appreciated!

Thank you

Peter H
Guest
Peter H

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

Simon
Guest
Simon

Hi Jos, I have 2 questions, first one is? We have updated to use the v3.10 but we are still getting the ‘Mapping cannot continue because we could not contact Office 365’ error pop up but the drive maps fine? This is occurring on laptops & desktops. Here is the part of the log where the error occurs; 08/10/2017 15:11:00 | INFO | Zone 2 was set to 3, setting it to 3 08/10/2017 15:11:01 | INFO | Base URL: https://portwaratah-my.sharepoint.com/_layouts/15/MySite.aspx?MySiteRedirect=AllDocuments 08/10/2017 15:11:01 | INFO | Zone 3 was set to 3, setting it to 3 08/10/2017 15:11:02 | INFO… Read more »

sebus
Guest
sebus

Not working (3.09 and 3.10) for the last few days: ERROR | There was an issue while trying to log in during attempt 3 INFO | detected user logged in Tile in IE INFO | login detected, login function succeeded, final url: https://portal.office.com/AdminPortal/Home#/homepage INFO | IE login function succeeded INFO | Detected user: user_domain_com INFO | Onedrive cookie generated, mapping drive… INFO | Mapping target: \tenantname-my.sharepoint.com@SSLDavWWWRootpersonaluser_domain_comDocuments ERROR | ERROR: detected string error 224 in return code of net use command, this usually means your trusted sites are misconfigured or KB2846960 is missing ERROR | failed to contact O: after mapping… Read more »

trackback

[…] OneDriveMapper […]

Morten Wiingreen
Guest

Hi Jos.

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

Any idea why IE does not log in ?

Best regards and thanks for a great script.

Ferron
Guest
Ferron

Hallo Jos,

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

Alvast bedankt!

Matt R
Guest
Matt R

Hi Jos,

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

Phil Warren
Guest
Phil Warren

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

Matt
Guest
Matt

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

System error 224 has occurred
Access Denied. Before opening files in this location, you must first add the web site to your trusted sites list, browse to the web site, and select the option to login automatically.

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

Many Thanks

MJ TFSB
Guest

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

Gary
Guest
Gary

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

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

Many thanks

Duncan Wraight
Guest
Duncan Wraight

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

Gabe W
Guest
Gabe W

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

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

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

Thanks

Luke Pollard
Guest

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

Duncan Wraight
Guest
Duncan Wraight

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

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

Thanks,
Duncan

Duncan Wraight
Guest
Duncan Wraight

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

Steph
Guest
Steph

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

Yasin Akbulut (NL)
Guest
Yasin Akbulut (NL)

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

Peter H
Guest
Peter H

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

Kevin Davies
Guest

Jos,

Where can I contribute to your wonderful script.

Cody Belcher
Guest
Cody Belcher

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

Skrie
Guest
Skrie

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

Maritin
Guest
Maritin

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

Niglbrown
Guest
Niglbrown

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

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

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

Bobby Lansing
Guest
Bobby Lansing

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

Petter
Guest
Petter

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

Rogier
Guest
Rogier

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