Link to home
Create AccountLog in
Avatar of RSMTECH_KC
RSMTECH_KCFlag for United States of America

asked on

Workaround or user script to include local appdata in roaming profile?

Hello, and thanks in advance.

We recently upgraded our terminal server farm to 2008 R2.  There are six load balanced servers in the farm.  I am using roaming profiles and folder redirection for my users.

The problem I have run into is that we use SAP as our core application and this program stores user specific information in the AppData/Local and AppData/LocalLow folders.  In Server 2008 R2 these folders are not included in the roaming profile so all user changes within SAP are lost when the user logs off.  This is very frustrating for them (and me!!).

Is there a reliable method to include or sync these folders with the roaming profile?  I have played around with user logoff scripts via GPO using XCOPY and ROBOCOPY but the results are sporadic at best.  Sometimes all of the data is copied and it works great.  Other times just empty folders get created and no data is transferred. There are also times that the directory is completely wiped out in the roaming profile.

Has anyone had this same problem?  Is there a better script or method to use here or some sort of workaround?  Any help would be greatly appreciated.  I've been hitting my head against a wall for awhile now.  Thanks!!
Avatar of kevinhsieh
Flag of United States of America image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of RSMTECH_KC


ROBOCOPY "Source is Local AppData" "Destination is Roaming Profile location" /S /IS /IT /LOG+:INFO

Are you sure a logon script to copy the files back to the server is neccesary?  As of now it is loading successfully with the roaming profile.  The only problem I have is that in certain instances the destination folder is deleted.  Is there a way that I can set ROBOCOPY to copy the files no matter what?  Here are the scenarios where it works and when it doesn't.

Typical Scenario  (Script copies files successfully)

1.  User logs into TS and roaming profile is loaded
2.  User logs into SAP
3.  SAP writes user data to AppData/Local
4.  User logs out of TS
5.  Script copies AppData/Local to users roaming profile location
6.  This data is then loaded with the roaming profile upon next user login

Atypical Scenario (When script erases destination folder)

1.  User logs into TS and roaming profile is loaded
2.  AppData/Local is loaded and visible in local server profile
3.  User does not log into SAP
4.  SAP does not modify user data in AppData/Local
5.  User logs out of TS
6.  Script runs and AppData/Local is deleted in users roaming profile location

Am I using the wrong switches?  I don't understand why the script is deleting the destination folder if the files have not been modified?  Its not like the directory is empty?

Thanks for the response.

I think we might be talking about different versions of SAP?  Either that or we are using a different way of delivering the app to end users.  We use SAP Business One 8.81 through 2008 R2 terminal servers.  I wasn't able to locate the file(s) you mentioned in your post.
just looked at your robocopy copy command.  I never use the /IS /IT switches.  Are they needed?
have you tried without those, just the /S ?  I would use /E instead of /S in case some folder structure needs to be copied (e.g. some blank folder may be needed only at certain times?   /s would not copy empty folders).

How do the users start the SAP, a desktop icon?
Could you create a batch file instead. In the batch file you could set some marker or flag file that will show that the SAP program was started, then during the logoff script make a test for the marker/flag file, then copy the folder or ignore the copy depending on the state. In the logon script, at the end clean up the marker/flag file - reset the state.
Thanks.  I was able to create a couple new scripts and its now working.  Thanks for the help!
Care to share those working logon/logoff scripts?
I'm having a hard time to make them work correctly.
Many thanks in advance!