Jump to content
Welcome to our new Citrix community!
  • 1

OneDrive does not start with Published Applications


Question

We're in the process of building out a new "Virtual Apps" Deployment based on Win2016.

 

We've switched over to FSLogix profile and Office containers, as well as installed OneDrive with the /allusers switch. The install goes into C:\Program Files (x86)\; as it always should have.

 

When a user launches a Published Desktop, there is no problem. OneDrive launches and configures itself for the user. The OneDrive folder and client is finally working, and working well.


The problem is published applications- the OneDrive client does not start automatically. If I create a batch script to launch the app (i.e. Notepad) and add OneDrive.exe, the client launches but the auto-sign-in doesn't work; the user is just presented with a pop-up to continue to sign in, and it's blank. One the Published Desktop, this is completely seamless.  The PA is launched from the same server that is hosting the Desktop, so same GPO applies.

 

Has anyone deployed the new OneDrive client and using it with published applications??

Link to comment

24 answers to this question

Recommended Posts

  • 1

Sorry for late reply, we originally had the same issue, worked fine in desktop but not streamed

In our environment getting the autologon to work with streamed apps we needed:

  • Install OneDrive per machine
  • The Office 365 support dudes had to enable Single-sign-on globally via the 365 portal. (paraphrasing, sorry not my dept.)
  • EnableADAL (HKCU\MS\OneDrive) set to 0x2
  • The normal OneDrive GPOs, i.e. setting the tenant etc.
  • The GPO - user logon script as mentioned earlier to launch "....\Onedrive.exe /background"

We then had the issue of Windows Explorer no refreshing automatically. This was solved with disable systray agent in seamlessflags.

 

Regarding the OneDrive deleting files and resetting modify dates, we still wait for MS Dev on this.

In our parallel testing, it seems this doesn't occur if we don't split FSLogix across Profile and O365 Profile which is how we had it before. We nor run everything in the FSLogix profile and so-far it seems more stable. But we await final word from MS.

 

 

  • Like 1
Link to comment
  • 1

Actually I finally found a solution that is working. 

1. Install OneDrive using the /AllUsers switch

2. Set a Logon script to start Onedrive in the background {I'm using Powershell here} Start-Process 'C:\Program Files (x86)\Microsoft OneDrive\OneDrive.exe' /background

3. Set a registry preference to HKCU\Software\Microsoft\OneDrive\EnableADAL (DWORD, value 2).

4. Set runonce.exe /alternateshellstartup in the logon script parameters. It loads the entire profile, but I'll take it to get OneDrive working properly.

 

image.thumb.png.35aab0b4e296075bc8fa642e0bbc05f0.png

 

We finally have OneDrive working for PA's.

 

  • Like 1
Link to comment
  • 1

Hi All,

 

For anyone still struggling with getting OneDrive to launch at session start I've found another solution (with it's own easier to swallow caveats).

 

First up, credit where credit is due to James Rankin for article here: https://james-rankin.com/articles/quickpost-how-to-start-a-process-when-a-citrix-published-application-launches/

 

1) Create a file to launch OneDrive in your install location, In my example I named it Launched.cmd

cd "C:\Program Files\Microsoft OneDrive"
start OneDrive.exe /background

 

2) Navigate to the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon

3) Edit the existing AppSetup REG_SZ by adding your launcher file, example of mine below

UsrLogon.cmd,cmstart.exe,"C:\Program Files\Microsoft OneDrive\Launcher.cmd"

 

4) Set the permissions on "C:\Program Files\Microsoft OneDrive" folder accordingly. In my case I remove the default "Users" ACL and instead add my FSLogix Security group so that only the intended users have the OneDrive Sync client launch on login

 

For those with the appropriate read permissions on the OneDrive folder the sync client loads successfully and for those that don't it just fails quietly in the background and they are none the wiser.

 

I've had this setup in my old Citrix farm for at least a year and both the launcher file and OneDrive folder permissions are not messed with by the regular auto-update of OneDrive.

 

Only posting this now as I had to figure out what I did when I encountered the problem again setting up a new environment.

 

Hopefully someone finds this helpful.

  • Like 1
Link to comment
  • 0

We've got OneDrive working with both Thin Client Published Desktops as well as hundreds of applications.  Our Apps are not running on the same servers as our desktops, but other than that we've not done anything different between the servers as far as GPOs or the OneDrive client install.  Our environment is running on 2016 servers with the Desktop servers in Azure and the App servers in AWS.

 

We do run a couple of PoSH Login scripts to setup the OneDrive environment.  Essentially we check to see if OneDrive is installed (for the specific user).   This is all preceded with an AutoIT script that assists with gathering the various info such as the user's email address.

 

 

    # Launch AutoIT script
    Write-Host "Starting AutoIT script"
    start "\\domain.net\tsresource\Profiles\Auto-OneDrive.exe"

#If installed  :
# Start OneDrive for user and wait for it to finish
       Write-Host "Starting OneDrive"
    & "$env:LOCALAPPDATA\Microsoft\OneDrive\OneDrive.exe" | Out-Null

 

#If not installed :

Write-Host "Installing Onedrive"
    & "C:\Program Files (x86)\Microsoft OneDrive\OneDriveSetup.exe" /silent | Out-Null

 

#Then we open OneDrive :

    # Open OneDrive with prepopulated email
     Write-Host "Call OneDrive and configure"
    start odopen://sync?useremail=$UserEmail

 

    Write-Host "Write user variables"
    $OneDrivePath = "$($env:USERPROFILE)\OneDrive - CompanyName"
    $env:OneDrive = $OneDrivePath
    $env:OneDriveSync = $OneDrivePath
    $env:OneDriveExists = $true
    Write-Host "Complete

Link to comment
  • 0
4 hours ago, DFDS Datacentre said:

Yes, we have setup with latest release of FSlogix and Windows 2019 (now supported with release ..\2.9.7117.27413)

 

I have too, however in a situation where a user does not log into a full desktop, and only using Published Applications, the OneDrive folder never gets initialized. However, if the user logs into a Published Desktop (on the exact same server), it does- with no problem. I don't think this is an FSLogix issue- I have a feeling it's a OneDrive/Published Application issue.


So I suspect there's something with the OneDrive.exe being in \Program Files (x86)\ that it never starts under a Published App.

 

Anyone else see the same?

Link to comment
  • 0
On 8/6/2019 at 3:36 PM, David Clark1709160691 said:

"$env:LOCALAPPDATA\Microsoft\OneDrive\OneDrive.exe"

 

It looks like you're using the older OneDrive client that was installed into user's profiles. We did do this initially, however since Microsoft has released an updated client that installs with the /allusers switch, it no longer puts itself into user's profiles- so you don't "need" these initial logon scripts.

 

However the problem with the /allusers version, is that it doesn't seem to start with Published Applications. The older version in the profile, however does.

No trouble with Published Desktops, however.

 

This is what we're using (or trying to):

https://docs.microsoft.com/en-us/onedrive/per-machine-installation

 

Link to comment
  • 0

Hey Cameron, this issue reminded me of something that Carl Stalhood posted about for Internet Explorer.  The section to look at is under the "Published Internet Explorer Settings – Runonce" in the link below.  You might see if the runonce.exe /alternateshellstartup is enough to get you what you need. I'm not 100% certain if this will help you but it wouldn't hurt to try.

 

https://www.carlstalhood.com/group-policy-objects-vda-user-settings/#ie 

Link to comment
  • 0

I think this is on the right track, however it still doesn't start.


I've even written a small batch file to start the OneDrive.exe process before (e.g. Notepad), then start Notepad. On the Desktop, OneDrive and Notepad start with no problem from the batch file.

 

As a published Batch file, it just doesn't. Notepad will start from the batch file but the OneDrive exe doesn't. 


Something in the OneDrive EXE is looking for some piece of a Full Desktop in order to run.

Link to comment
  • 0
On 9/23/2019 at 2:46 PM, Cameron Gladman1709153679 said:

I think this is on the right track, however it still doesn't start.


I've even written a small batch file to start the OneDrive.exe process before (e.g. Notepad), then start Notepad. On the Desktop, OneDrive and Notepad start with no problem from the batch file.

 

As a published Batch file, it just doesn't. Notepad will start from the batch file but the OneDrive exe doesn't. 


Something in the OneDrive EXE is looking for some piece of a Full Desktop in order to run.

We do have this running consistently at the moment on 2019, when we include the GPO use logon script to run:

"C:\Program Files (x86)\Microsoft OneDrive\OneDrive.exe" /background

 

We also had to apply some changes to our ADFS setup to get the automatic authentication working.

 

There are still a few issues to resolve before we can push to the users.

 - Published windows Explorer not refreshing, seems to be solve by seamlessflags (remove the tray icon)

 - Running local OneDrive and Citrix OneDrive caused issues which are under investigation still.. (Mass file deletions and modify dates set back to 1980)

So not exactly production ready for us yet.

Link to comment
  • 0
7 minutes ago, DFDS Datacentre said:

We also had to apply some changes to our ADFS setup to get the automatic authentication working.

 

Can you elaborate on what you needed to do? Desktop access works fine; sign-in is seamless- PA's don't.

 

8 minutes ago, DFDS Datacentre said:

 - Running local OneDrive and Citrix OneDrive caused issues which are under investigation still.. (Mass file deletions and modify dates set back to 1980)


Wow that's a biggie. I'll keep an eye out for that.

 

I really don't want to go back to the OneDriveMapper script, but if we have to, we have to. OneDrive on RDS still needs work.  Things were far easier when everything was on our on-prem file servers; we had no such issues at all.

Link to comment
  • 0

It looks like there's the beginnings of an answer here:

 

https://techcommunity.microsoft.com/t5/Windows-Virtual-Desktop/Start-OneDrive-when-using-a-RemoteApp-in-WVD/m-p/877349/highlight/false#M1539

 

Same problem on RemoteApp. They seem to have a solution, but I think it may only work with RemoteApp sessions, not HDX- I've tried it and have not been successful.

 

Is there an equivalent key for HDX sessions?

Link to comment
  • 0
On 10/3/2019 at 10:17 AM, DFDS Datacentre said:

Sorry for late reply, we originally had the same issue, worked fine in desktop but not streamed

In our environment getting the autologon to work with streamed apps we needed:

  • Install OneDrive per machine
  • The Office 365 support dudes had to enable Single-sign-on globally via the 365 portal. (paraphrasing, sorry not my dept.)
  • EnableADAL (HKCU\MS\OneDrive) set to 0x2
  • The normal OneDrive GPOs, i.e. setting the tenant etc.
  • The GPO - user logon script as mentioned earlier to launch "....\Onedrive.exe /background"

We then had the issue of Windows Explorer no refreshing automatically. This was solved with disable systray agent in seamlessflags.

 

Regarding the OneDrive deleting files and resetting modify dates, we still wait for MS Dev on this.

In our parallel testing, it seems this doesn't occur if we don't split FSLogix across Profile and O365 Profile which is how we had it before. We nor run everything in the FSLogix profile and so-far it seems more stable. But we await final word from MS.

 

 

Thanks dfds2003 for the above which is working as expected. 

 

Has anyone else come across an issue where the VHD reaches capacity in fslogix as from the fslogix site it looks like it will behave the same was as a PC, and we don't want to be going down the route of setting the VHD's to the same available space in onedrive? is there anyway of clearing down the Hard disk on log off ? maybe files not accessed for a set period or clear it down completely?

 

Thanks in advance.

 

What is the user experience like when I limit the disk space for OneDrive for Business with FSLogix? 
When the FSLogix Container is full, OneDrive will report that it cannot synchronize current or new files. The user experience is identical to PCs, laptops or Surface devices.

 

Link to comment
  • 0

This has turned into a bit of a mess.


On the one hand, Citrix is pushing their products. On the other hand, Microsoft is pushing everyone to use OneDrive. Yet there's no functionality, nor response from either on how to make one product work with the other using Published Apps...which is really the whole point of using Citrix XenApp (insert product name of the year here). Otherwise we'd just go Remote App. They seem to have a solution for Remote App now, but doesn't work with Citrix Published Apps.

 

It's left to us to hack something together that doesn't really work that well.

Link to comment
  • 0
On 11/7/2019 at 3:24 PM, Cameron Gladman1709153679 said:

This has turned into a bit of a mess.


On the one hand, Citrix is pushing their products. On the other hand, Microsoft is pushing everyone to use OneDrive. Yet there's no functionality, nor response from either on how to make one product work with the other using Published Apps...which is really the whole point of using Citrix XenApp (insert product name of the year here). Otherwise we'd just go Remote App. They seem to have a solution for Remote App now, but doesn't work with Citrix Published Apps.

 

It's left to us to hack something together that doesn't really work that well.

I agree to this statement, and its a big issue for all M365 / Azure stuff and not isolated to Onedrive.

I still fail to find any solution for this, and people are not good at returning to the post if they found a solution. If anybody have one, I would appreciate it even if it's a workaround / hack

Link to comment
  • 0
24 minutes ago, Cameron Gladman1709153679 said:

Actually I finally found a solution that is working. 

1. Install OneDrive using the /AllUsers switch

2. Set a Logon script to start Onedrive in the background {I'm using Powershell here} Start-Process 'C:\Program Files (x86)\Microsoft OneDrive\OneDrive.exe' /background

3. Set a registry preference to HKCU\Software\Microsoft\OneDrive\EnableADAL (DWORD, value 2).

4. Set runonce.exe /alternateshellstartup in the logon script parameters. It loads the entire profile, but I'll take it to get OneDrive working properly.

 

image.thumb.png.35aab0b4e296075bc8fa642e0bbc05f0.png

 

We finally have OneDrive working for PA's.

 

Thanks, but the runonce.exe /alternateshellstartup does not do the trick. The onedrive /background adds the onedrive to the tray but it's status is Not Signed in.

And the EnableADAL I don't believe is honored anymore in Onedrive, at least it does not make any difference if added

Link to comment
  • 0

Just adding to this post in case anyone comes across it looking for a different method to band aid this problem. 

I had exact same issue - OneDrive would open, but wouldnt log in automatically and if I attempted to login manually it just gave me an error after entering the credentials. 

 

We are using Citrix Cloud + Azure AD for authentication.

 

I have our Published App setup to launch Powershell.exe with the arguments to launch a ps1 script/file - as per screenshot.

 

Users are running OneDrive from their AppData folders - I couldnt be bothered gutting and reinstalling the AllUser version that installed to Program Files - and it worked without doing that anyway. However, I added into the script a check for the OneDrive location, just in case - and also if my Apps Team changes the installation around, I wont need to adjust the script.

 

image.thumb.png.88ce9f78f8eac228f373017edac87248.png

 

Main contents of the ps1 script that is associated to this particular fix are as follows - in order:

#####################

Start-Process -FilePath "runonce.exe" -ArgumentList "/AlternateShellStartup"

 

$OneDrivePath = $env:USERPROFILE + "\AppData\Local\Microsoft\OneDrive\OneDrive.exe"

New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\OneDrive" -Name "EnableADAL" -Value 2 -PropertyType DWORD -Force | Out-Null

 

if(Test-Path $OneDrivePath)

{

     Write-Host Starting OneDrive from LocalProfile
     Start-Process -FilePath $OneDrivePath -ArgumentList "/background"

}ELSE{

     if(Test-Path "C:\Program Files (x86)\Microsoft OneDrive\OneDrive.exe")
     {

          Write-Host Starting OneDrive from ProgramFiles
          Start-Process -FilePath "C:\Program Files (x86)\Microsoft OneDrive\OneDrive.exe" -ArgumentList "/background"

     }ELSE{
     Write-Host OneDrive EXE not exist....
     }

}

 

Explorer "C:\Users\Public\Desktop" # This is For Testing

 

# Launch my application

Start-Process -FilePath "C:\Program Files (x86)\Communicare\CCare.exe" -WorkingDirectory "C:\Program Files (x86)\Communicare\"

#####################

 

Worked like a treat. OneDrive logging in automatically and sync'ing successfully now from the published app.

 

Hope that helps someone

Link to comment
  • 0
On 8/3/2019 at 1:02 AM, Cameron Gladman1709153679 said:

We're in the process of building out a new "Virtual Apps" Deployment based on Win2016.

 

We've switched over to FSLogix profile and Office containers, as well as installed OneDrive with the /allusers switch. The install goes into C:\Program Files (x86)\; as it always should have.

 

When a user launches a Published Desktop, there is no problem. OneDrive launches and configures itself for the user. The OneDrive folder and client is finally working, and working well.


The problem is published applications- the OneDrive client does not start automatically. If I create a batch script to launch the app (i.e. Notepad) and add OneDrive.exe, the client launches but the auto-sign-in doesn't work; the user is just presented with a pop-up to continue to sign in, and it's blank. One the Published Desktop, this is completely seamless.  The PA is launched from the same server that is hosting the Desktop, so same GPO applies.

 

Has anyone deployed the new OneDrive client and using it with published applications??

 

Check out my post on page 2 for some steps on how to seamlessly launch OneDrive when opening any published app. This way it'll load in the background regardless of which application your users launch in Citrix.

 

As for automatic sign-in, I've always had trouble using the "Silently sign in users to the OneDrive sync app with their Windows credentials" and turn this off. Apparently it requires that the machine is Azure AD joined, which my VDA's are not. I've also experienced the problem of a blank or indefinitely loading sign-in page when using this GPO setting. If that's enabled then try turning it off. Sure your users will need to enter their email address upon first setup, but with FSLogix it should be saved thereafter.

Link to comment

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...