Jump to content

Recommended Posts

Posted
So just to clarify you're basically giving an Admin user full access rights to each users OneDrive for Business area and then adding each area manually on the OneDrive for Business Sync client that is installed on the server? Out of interest how many areas in total are you syncing with the one client?

 

A couple of potential issues I can think of with this set up is if you ever have to perform a repair, I think the client ends up having to repair each synced library. Also you'll probably need a load of free space on the system drive of the server as the OneDrive for Business client typically needs the same storage space used on OneDrive as it does in the local AppData folder that is running the client.

 

That's correct - it's also useful for admin purposes being able to view user OneDrives, just as you would on Windows Server.

 

I don't think any solution is perfect, but it makes me wonder if they're going to include a native client in Windows 10, whether there will be one in Windows 10 Server (which is essentially what I'm doing) - just syncing many Libraries instead of a handful.

Posted

Latest update -

 

The OneDrive client became more unstable the more data/libraries I created and it eventually crashed, which is no good!

 

I've since found this I'm going to look into :)

Posted

Hi Michael,

 

This is what I was doing with the cookie365 utility, all most seamless i.e. it uses your logged in credentials if you have ADFS server deployed. It does need username and password from outside network but its from an user point of view, its all pretty much seamless. there is nothing to sync because they are accessing the documents live from the internet.

 

Ash.

Posted
Hi Michael,

 

This is what I was doing with the cookie365 utility, all most seamless i.e. it uses your logged in credentials if you have ADFS server deployed. It does need username and password from outside network but its from an user point of view, its all pretty much seamless. there is nothing to sync because they are accessing the documents live from the internet.

 

Ash.

 

Thanks but the environment I'm testing in is none ADFS, just standalone, if that makes any difference?

 

- - - Updated - - -

 

have you looked at work folders it might be a better solution and is fairly simple to set up

 

Could you provide another guide how to go about this?

Posted
Thanks but the environment I'm testing in is none ADFS, just standalone, if that makes any difference?

 

- - - Updated - - -

 

 

 

Could you provide another guide how to go about this?

 

https://4sysops.com/archives/work-folders-part-2-server-installation/

 

thats the guide i used iirc. Only real diff was i cheated and used self signed certs and my network domain and the external one i used diddnt even slightly match (it was a test setup so it was some random domain and the domain i sue for my personal email as i never use it for owt else)

 

basically iirc set up a 2nd internal dns zone with whatever you want your external name to be so schoolworkfolders.co.uk as an example create an a record for workfolders and give it the ip of your workfolders server. because i was doing it at home i just port forwarded port 443 to from my router to my test server. create an external a record for workfolders.schoolworkfolders.co.uk and in theory thats the only things iirc arnt covered in that guide (apart from dealing with self signed certs))

Posted

Hi all

 

Very useful thread.

 

We are also planning to go Office 365/ OneDrive and Sharepoint for all students and staff in the future, we have 100 my lease line

 

If we plan to map OneDrive as a potential Home Drive replacement would there be potential login issues when large amount of users map to the OneDrive as a login? For example slow logins?

 

How would media and Graphics students find uploading of large files to OneDrive?

 

How would you plan Backup Strategies? We use DPM at the moment

 

If we use Sharepoint as a replacement for departmental drives, is the Sharepoint 1TB limit per site? If so I was planning to create departmental sites (upto 1TB each, like English, Maths etc) and map them as departmental network drives

 

My main concern is performance, do I upgrade my lease line? Do I need to look at my switch infrastructure ? (It's 1gb Netgear smart switches at the edge, and Netgear Core Switch linking the edge switches via 1Gb fibre)

 

Thanks as always

Posted (edited)

Watch out for Microsoft throttling the upload bandwidth, that's what I've heard from some other people who have tried it so far

 

have you looked at work folders it might be a better solution and is fairly simple to set up

 

Is that Work Folders using OneDrive somehow or just providing OneDrive-esque functionality but still using a classic Windows File Share as the data storage location?

Edited by gshaw
Posted
Watch out for Microsoft throttling the upload bandwidth, that's what I've heard from some other people who have tried it so far

 

 

 

Is that Work Folders using OneDrive somehow or just providing OneDrive-esque functionality but still using a classic Windows File Share as the data storage location?

 

its using your internal server 2012r2 and its existing file structure and making it accessible (under certain conditions) to the outside world. its 100% separate from onedrive just works similar to end users

Posted

Below is what you need to do to map OneDrive for Business on Windows 7:

 

Open up the services.msc and change the WebClient service from Manual to Automatic and then start it if required. You could enable this using GPP and RSAT.

 

Open Control Panel, then add the below URL to your Trusted Sites. You could specify this using a GPO.

 

https://*.sharepoint.com

 

Navigate to IE10 or IE11, sign into O365 and remember to tick 'Keep me signed in'

 

Navigate to OneDrive, then copy the URL in the address bar. It'll look something like this:

 

https://randomsite-my.sharepoint.com/personal/random_address/Documents/Forms/All.aspx

 

You need to remove the ending, so it looks like this:

 

https://randomsite-my.sharepoint.com/personal/random_address/Documents

 

From Explorer, select Map Network Drive, copy/paste your URL then tick 'Connect using different credentials'

 

Specify your O365 username/password in full and all being well your network drive will map correctly.

 

So now I see just the one issue -

 

Other than providing detailed documentation, it seems impossible to deploy OneDrive for Business automatically to a group of users, as it relies on cookies to authenticate. When I say deploy, you couldn't map OneDrive as the home directory automatically (in Active Directory), as you'd still have the issue of cookies to authenticate at the initial stage.

 

On a plus side, this is a good workaround instead of using the relatively unstable OneDrive for Business client, using Windows Explorer itself, which is already built to handle uploading files to remote/cloud sources.

 

The exact same process applies to Windows 10 Beta and presumably Windows 8.1, apart from the WebClient service already appears to be enabled by default.

 

I hope this helps someone else :)

Posted
Below is what you need to do to map OneDrive for Business on Windows 7:

 

Open up the services.msc and change the WebClient service from Manual to Automatic and then start it if required. You could enable this using GPP and RSAT.

 

Open Control Panel, then add the below URL to your Trusted Sites. You could specify this using a GPO.

 

https://*.sharepoint.com

 

Navigate to IE10 or IE11, sign into O365 and remember to tick 'Keep me signed in'

 

Navigate to OneDrive, then copy the URL in the address bar. It'll look something like this:

 

https://randomsite-my.sharepoint.com/personal/random_address/Documents/Forms/All.aspx

 

You need to remove the ending, so it looks like this:

 

https://randomsite-my.sharepoint.com/personal/random_address/Documents

 

From Explorer, select Map Network Drive, copy/paste your URL then tick 'Connect using different credentials'

 

Specify your O365 username/password in full and all being well your network drive will map correctly.

 

So now I see just the one issue -

 

Other than providing detailed documentation, it seems impossible to deploy OneDrive for Business automatically to a group of users, as it relies on cookies to authenticate. When I say deploy, you couldn't map OneDrive as the home directory automatically (in Active Directory), as you'd still have the issue of cookies to authenticate at the initial stage.

 

On a plus side, this is a good workaround instead of using the relatively unstable OneDrive for Business client, using Windows Explorer itself, which is already built to handle uploading files to remote/cloud sources.

 

The exact same process applies to Windows 10 Beta and presumably Windows 8.1, apart from the WebClient service already appears to be enabled by default.

 

I hope this helps someone else :)

 

yeah it works fine on 8.1 couldn't get it working on y7 will give the service a try later when I cba lol

Posted

Below is a script I've created which maps OneDrive for Business as O:\, deletes/re-creates the drive if it exists and then renames it to OneDrive.

 

Option Explicit
Dim objNetwork, strDrive, objShell, objUNC, objFSO, wshShell
Dim strRemotePath1, strDriveLetter1

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objNetwork = CreateObject("Wscript.Network")

strDriveLetter1 = "O:" 
strRemotePath1 = "https://randomsite-my.sharepoint.com/personal/random_address/Documents" 

If (objFSO.DriveExists("O:") = True) Then
   objNetwork.RemoveNetworkDrive "O:", True, True
End If
   Set objNetwork = CreateObject("WScript.Network") 
   objNetwork.MapNetworkDrive strDriveLetter1, strRemotePath1 

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\##randomsite-my.sharepoint.com@SSL#DavWWWRoot#personal#random_address#Documents\_LabelFromReg", "OneDrive", "REG_SZ"

WScript.Quit

 

Just change areas where it says randomsite and random_address to match your site/user. Change every instance of O: to your preferred drive letter and rename OneDrive to your preferred name (if different).

 

I can't work out how I can specify different credentials - in this case, the full O365 user/pass. If it is possible, then a separate script could be specified per user in Active Directory to run automatically/silently at logon - again, all in theory :)

Posted

Ok so, having read most of the thread and going over much of my previous work I have done on this I decided to have another look.

 

Turns out that a script already existed as far back as May last year, not that I found it the last time round. Here is the original script.

 

It uses a concept that I hadn't considered before, which is to use powershell to launch and then control IE in the background to do the authentication. This process appears to more or less eliminates the problems that people encounter when trying to map OneDrive, though I have only tested it on my own machine (Windows 8.1). It is also possible that the connection will drop off when you restart/log off, so a possible alternative would be to have the drive be remapped every time you login, though I haven't looked at that.

 

I take no credit for any of this really given the original script works in the same way, but I have condensed that original script into the following for simple testing, I would appreciate if you have a go @Michael:

 

$user = [Environment]::UserName

$siteName = "examplesch"
$emailDomain = "exampleschool.co.uk"
$urlDomain = "_exampleschool_co_uk" # The Email Domain split up with '_' for dividers, the leading one is important

$urlsite = "https://" + $siteName + "-my.sharepoint.com/personal/"
$mapsite = "\\" + $siteName + "-my.sharepoint.com@SSL\DavWWWRoot\personal\"

$emailusername = $user + "@" + $emailDomain
$urlFile = $urlsite + $user + $urlDomain + "/Documents"
$mapPath = $mapsite + $user + $urlDomain + "\Documents"

$driveLetter = 'O:'

If(!(Test-Path -Path $driveLetter)) # Checks if the drive is in use
{
   $ie = new-object -com InternetExplorer.Application
   $ie.navigate("http://login.microsoftonline.com/logout.srf")
   do {sleep 1} until (-not ($ie.Busy)) 

   $ie.quit()

   $ie = new-object -com InternetExplorer.Application
   $ie.navigate("https://login.microsoftonline.com/login.srf")
   do {sleep 1} until (-not ($ie.Busy)) 
  
   try
   { 
       $ie.document.GetElementById("_link").click()
    do {sleep 1} until (-not ($ie.Busy)) 
   }
   catch { $null }

   try
   { 
       $ie.document.GetElementById("cred_keep_me_signed_in_checkbox").click()
    $ie.document.GetElementById("cred_userid_inputtext").value = $emailusername
    $ie.document.GetElementById("cred_sign_in_button").click()
    do {sleep 1} until (-not ($ie.Busy)) 
   }
   catch  {$null } 

   sleep -seconds 15

   $ie.navigate($urlFile)
   do {sleep 1} until (-not ($ie.Busy))
   sleep -seconds 5

   $ie.quit()
      
   NET USE $driveLetter $mappath /PERSISTENT:YES
}

  • Thanks 1
Posted (edited)

Open Control Panel, then add the below URL to your Trusted Sites. You could specify this using a GPO.

 

For some reason SharePoint and OneDrive keep coming up as Unknown Zone (Mixed) despite adding all the usual *.sharepoint.com addresses. Seems like based on the source code there's a CDN throwing it out but I can't get ODFB into Trusted Sites for love nor money at the moment :mad:

 

Edit: actually something has changed from when I've tried this before, looks like MS have brought the CDN addresses in under their own URL now and the PowerShell script now works (we have SSO so just have to wait for the browser to auto-authenticate in the background) :D

 

That's using the PowerShell script referenced a few pages back and condensed above. I've got a similar version of it that I was testing, almost identical to that posted by @JRowley above bar the position of the variables at the top.

Edited by gshaw
Posted
Oh was that posted before? I had a good look through the thread but couldn't find any reference too it, I guess I missed it sorry!
Posted
Actually I think it was on another OneDrive-related thread but this one is more current so good to have it posted again. Also works better in the condensed form without all the additional steps where it was mapping UNC paths, which seemed a bit pointless imo, the version above is plug and play :)
Posted

Unfortunately the script doesn't work for me, but my script does work once you've manually mapped it - which sort of defeats the objective.

 

What I can't get my head around, is even if I add the credentials manually in Control Panel - Control Panel > User Accounts > Manage your credentials (then scroll down to the bottom), it still doesn't work, yet when I manually map it, it adds another entry that's exactly the same.

 

Without something third party, or a proper solution from Microsoft, I can't see how I'll ever be able to deploy OneDrive. I feel sorry for admins supporting literally thousands of users! :)

Posted
Unfortunately the script doesn't work for me, but my script does work once you've manually mapped it - which sort of defeats the objective.

 

What I can't get my head around, is even if I add the credentials manually in Control Panel - Control Panel > User Accounts > Manage your credentials (then scroll down to the bottom), it still doesn't work, yet when I manually map it, it adds another entry that's exactly the same.

 

Without something third party, or a proper solution from Microsoft, I can't see how I'll ever be able to deploy OneDrive. I feel sorry for admins supporting literally thousands of users! :)

 

Do you get an error?

 

The script below may provide more insight, it will display IE and won't kill it once it is finished with it:

 

$user 			= [Environment]::UserName

$siteName = "examplesch"
$emailDomain = "exampleschool.co.uk"
$urlDomain = "_exampleschool_co_uk" # The Email Domain split up with '_' for dividers, the leading one is important

$urlsite = "https://" + $siteName + "-my.sharepoint.com/personal/"
$mapsite = "\\" + $siteName + "-my.sharepoint.com@SSL\DavWWWRoot\personal\"

$emailusername = $user + "@" + $emailDomain
$urlFile = $urlsite + $user + $urlDomain + "/Documents"
$mapPath = $mapsite + $user + $urlDomain + "\Documents"

$driveLetter = 'O:'

If(!(Test-Path -Path $driveLetter)) # Checks if the drive is in use
{
   $ie = new-object -com InternetExplorer.Application
   $ie.navigate("http://login.microsoftonline.com/logout.srf")
   do {sleep 1} until (-not ($ie.Busy)) 

   $ie.quit()

   $ie = new-object -com InternetExplorer.Application
   $ie.navigate("https://login.microsoftonline.com/login.srf")
   $ie.Visible = $true
   do {sleep 1} until (-not ($ie.Busy)) 
  
   try
   { 
       $ie.document.GetElementById("_link").click()
    do {sleep 1} until (-not ($ie.Busy)) 
   }
   catch { $null }

   try
   { 
       $ie.document.GetElementById("cred_keep_me_signed_in_checkbox").click()
    $ie.document.GetElementById("cred_userid_inputtext").value = $emailusername
    $ie.document.GetElementById("cred_sign_in_button").click()
    do {sleep 1} until (-not ($ie.Busy)) 
   }
   catch  {$null } 

   sleep -seconds 15

   $ie.navigate($urlFile)
   do {sleep 1} until (-not ($ie.Busy))
   sleep -seconds 5

   #$ie.quit()
      
   NET USE $driveLetter $mappath /PERSISTENT:YES
}

Posted

Thanks, this looks more promising, however I modified it to work without ADFS:

 

$user = "user.name"
$user2 = "user_name"

$siteName = "examplesch"
$emailDomain = "exampleschool.co.uk"
$urlDomain = "_exampleschool_co_uk" # The Email Domain split up with '_' for dividers, the leading one is important

$urlsite = "https://" + $siteName + "-my.sharepoint.com/personal/"
$mapsite = "\\" + $siteName + "-my.sharepoint.com@SSL\DavWWWRoot\personal\"

$emailusername = $user + "@" + $emailDomain
$urlFile = $urlsite + $user2 + $urlDomain + "/Documents"
$mapPath = $mapsite + $user2 + $urlDomain + "\Documents"

$driveLetter = 'O:'

If(!(Test-Path -Path $driveLetter)) # Checks if the drive is in use
{
   $ie = new-object -com InternetExplorer.Application
   $ie.navigate("http://login.microsoftonline.com/logout.srf")
   do {sleep 1} until (-not ($ie.Busy)) 

   $ie.quit()

   $ie = new-object -com InternetExplorer.Application
   $ie.navigate("https://login.microsoftonline.com/login.srf")
   $ie.Visible = $true
   do {sleep 1} until (-not ($ie.Busy)) 
  
   try
   { 
       $ie.document.GetElementById("_link").click()
    do {sleep 1} until (-not ($ie.Busy)) 
   }
   catch { $null }

   try
   { 
       $ie.document.GetElementById("cred_keep_me_signed_in_checkbox").click()
    $ie.document.GetElementById("cred_userid_inputtext").value = $emailusername
    $ie.document.GetElementById("cred_sign_in_button").click()
    do {sleep 1} until (-not ($ie.Busy)) 
   }
   catch  {$null } 

   sleep -seconds 15

   $ie.navigate($urlFile)
   do {sleep 1} until (-not ($ie.Busy))
   sleep -seconds 5

   #$ie.quit()
      
   NET USE $driveLetter $mappath /PERSISTENT:YES
}

 

Any idea how to include the password?

Posted
I don't think you'll be able to do it this way without ADFS. There's no link between your O365 account and AD so you have to enter separate credentials, you can't do this automatically I don't think. You also can't to my knowledge grab the password from AD and then feed it into the authentication for O365, the only way would be if the password was stored in plain text, which it obviously isn't.
Posted

I've managed to sort it and it works -

 

$user = "user.name"
$user2 = "user_name"

$siteName = "examplesch"
$emailDomain = "exampleschool.co.uk"
$urlDomain = "_exampleschool_co_uk" # The Email Domain split up with '_' for dividers, the leading one is important

$urlsite = "https://" + $siteName + "-my.sharepoint.com/personal/"
$mapsite = "\" + $siteName + "-my.sharepoint.com@SSL\DavWWWRoot\personal"

$emailusername = $user + "@" + $emailDomain
$emailpassword = "password"
$urlFile = $urlsite + $user2 + $urlDomain + "/Documents"
$mapPath = $mapsite + $user2 + $urlDomain + "\Documents"

$driveLetter = 'O:'

If(!(Test-Path -Path $driveLetter)) # Checks if the drive is in use
{
   $ie = new-object -com InternetExplorer.Application
   $ie.navigate("http://login.microsoftonline.com/logout.srf")
   do {sleep 1} until (-not ($ie.Busy)) 

   $ie.quit()

   $ie = new-object -com InternetExplorer.Application
   $ie.navigate("https://login.microsoftonline.com/login.srf")
   $ie.Visible = $true
   do {sleep 1} until (-not ($ie.Busy)) 
  
   try
   { 
       $ie.document.GetElementById("_link").click()
    do {sleep 1} until (-not ($ie.Busy)) 
   }
   catch { $null }

   try
   { 
       $ie.document.GetElementById("cred_keep_me_signed_in_checkbox").click()
    $ie.document.GetElementById("cred_userid_inputtext").value = $emailusername
                 $ie.document.GetElementById("cred_password_inputtext").value = $emailpassword
    $ie.document.GetElementById("cred_sign_in_button").click()
    do {sleep 1} until (-not ($ie.Busy)) 
   }
   catch  {$null } 

   sleep -seconds 15

   $ie.navigate($urlFile)
   do {sleep 1} until (-not ($ie.Busy))
   sleep -seconds 5

   #$ie.quit()
      
   NET USE $driveLetter $mappath /PERSISTENT:YES
}

 

The only issue now is I have to click 'Sign in' manually. Anyway to automate this?

 

- - - Updated - - -

 

Hi @Michael are you using ADFS for single sign-on or DirSync with Password Sync?

 

I'm using neither of these - just a simple CSV import for O365 users.

Posted
Ah fair do's, the SSO would make the process seamless if you ever decide to go down that road. This does seem to be the most promising method of those I've seen so far though :)
Posted (edited)
Not really, the idea of the script is that IE is hidden, it's only visible in that script for debugging. If you use the IE window it opens to do a manual authentication then you can't have it automatically sign you in because it will click sign in as soon as it has put the email in. Edited by JRowley
Posted

Here's my latest modified script that does the following -

 

- Opens O365

- Enters your O365 username/password

- Automatically logs you in

- Re-directs to OneDrive in IE

- Re-directs to OWA

- Maps OneDrive

- Renames the drive to 'OneDrive'

 

This is tested/working using Windows 7 SP1 and Internet Explorer 10.0.27, as well as Windows 10 Beta, build 10074 :)

 

$user = "user.name"
$user2 = "user_name"

$siteName = "examplesch"
$emailDomain = "exampleschool.co.uk"
$urlDomain = "_exampleschool_co_uk" # The Email Domain split up with '_' for dividers, the leading one is important

$urlsite = "https://" + $siteName + "-my.sharepoint.com/personal/"
$mapsite = "\" + $siteName + "-my.sharepoint.com@SSL\DavWWWRoot\personal"
$urlsite2 = "https://outlook.office365.com/owa/"

$emailusername = $user + "@" + $emailDomain
$emailpassword = "password"
$urlFile = $urlsite + $user2 + $urlDomain + "/Documents"
$mapPath = $mapsite + $user2 + $urlDomain + "\Documents"

$driveLetter = 'O:'

If(!(Test-Path -Path $driveLetter)) # Checks if the drive is in use
{
   $ie = new-object -com InternetExplorer.Application
   $ie.navigate("http://login.microsoftonline.com/logout.srf")
   do {sleep 1} until (-not ($ie.Busy)) 

   $ie.quit()

   $ie = new-object -com InternetExplorer.Application
   $ie.navigate("https://login.microsoftonline.com/login.srf")
   $ie.Visible = $true
   do {sleep 1} until (-not ($ie.Busy)) 
  
   try
   { 
       $ie.document.GetElementById("_link").click()
    do {sleep 1} until (-not ($ie.Busy)) 
   }
   catch { $null }

   try
   { 
       $ie.document.GetElementById("cred_userid_inputtext").value = $emailusername
       $ie.document.GetElementById("cred_password_inputtext").value = $emailpassword
       $ie.document.GetElementById("cred_keep_me_signed_in_checkbox").click()
          do {sleep 5} until (-not ($ie.Busy))
    $ie.document.GetElementById("cred_sign_in_button").click()
          do {sleep 5} until (-not ($ie.Busy)) 
   }
   catch  {$null }
   
   sleep -seconds 5

   $ie.navigate($urlFile)
   do {sleep 1} until (-not ($ie.Busy))
   sleep -seconds 5
   
   $ie.navigate($urlSite2)
   do {sleep 1} until (-not ($ie.Busy))
   sleep -seconds 5

   #$ie.quit()
      
   NET USE $driveLetter $mappath /PERSISTENT:YES
   $regkey = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\##" + $sitename + "-my.sharepoint.com@SSL#DavWWWRoot#personal#" + $user2 + $urldomain + "#Documents"
   Set-ItemProperty -Path $regkey -Name _LabelFromReg -Type String -Value OneDrive
   }

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...