Link to home
Start Free TrialLog in
Avatar of RSMTECH_KC
RSMTECH_KCFlag for United States of America

asked on

SAP Business One on Server 2008 R2 with roaming profiles?

Does anyone use SAP Business One with roaming profiles?  I am stuck in an issue where SAP is storing critical user files in the local and locallow appdata folders, which are not included in the roaming profile.  What about a script to copy these files to the roaming profile at user log off?  

Any advice would be greatly appreciated.  Thanks!
Avatar of matrixnz
matrixnz

I'm assuming the SAPLOGN.ini file?

We're using SAP Gui with Business Explorer and came across the same thing, our SAP Admin sent me the following PDF which fixes the problem:
http://wise.winshuttle.com/getAttach/92/AA-01615/sapnote_0001031740.pdf
Below is the Script referred to in the pdf.

You basically just setup a machine SAPLOGON_INI_FILE environment variable pointing to what ever location you want the ini file to be found.

Hope that helps.

Cheers
strIniFile = NwEngine.Variables.ResolveString("%USERPROFILE%\AppData\Local\VirtualStore\Windows\saplogon.ini")
strCmdLine = "setx /M SAPLOGON_INI_FILE " & strIniFile
bNoWaiting = vbFalse
NwEngine.Shell.Execute strCmdLine, bNoWaiting

Open in new window

Avatar of RSMTECH_KC

ASKER

I'm not sure if this is the same.  Our users are working in the SAP B1 client on 2008 R2 terminal servers.  I was not able to locate the SAPLOGN.ini at C:\Windows.  The files that seem to be causing the issues for us are located at the following path; also listed are the names of the files themselves.

C:\Users\{UserProfile}\AppData\Local\SAP\SAP Business One\

b1-conf.dtd
b1-current-user.xml
-REGISTRY-HKEY_CURRENT_USER-SOFTWARE-SAP-SAP_Manage-SAP_Business_One-LogIN-Company-Company.binary
-REGISTRY-HKEY_CURRENT_USER-SOFTWARE-SAP-SAP_Manage-SAP_Business_One-LogIN-CompanyName-CompanyName.binary
-REGISTRY-HKEY_CURRENT_USER-SOFTWARE-SAP-SAP_Manage-SAP_Business_One-LogIN-Port-Port.binary
-REGISTRY-HKEY_CURRENT_USER-SOFTWARE-SAP-SAP_Manage-SAP_Business_One-LogIN-Server-Server.binary
-REGISTRY-HKEY_CURRENT_USER-SOFTWARE-SAP-SAP_Manage-SAP_Business_One-LogIN-ServerType-ServerType.binary

If these files are present in the user profile the user settings are remembered during SAP login.  If they are not present the user is forced to go through the initial process where they must choose a company, etc.
If it
a) just those two files
b) there is no way of changing SAP B1 to make it look for them somewhere else

why don't you just create a script that copys them to somewhere else in their profile and back again when the user logs off and on.

eg on logoff
copy %userprofile%\AppData\Local\SAP\SAP Business One\b1-conf.dtd %userprofile%\documents\
copy %userprofile%\AppData\Local\SAP\SAP Business One\b1-current-user.xml %userprofile%\documents\

on logon do the reverse

Seriously nasty and clunky as hell..... but it will more than likely work.
Thanks, aoakeley.  That's what I am doing now, minus the logon script part.  I am running a user logoff script that copies these files directly into the users roaming profile on the network share.  When the user logs in again these files are loaded back to the server with the roaming profile.  Problem solved...or so I thought.  If the user does not launch SAP, in turn these files are not modified and the logoff script is not only not copying the files back to the roaming profile share, it is actually deleting the folder altogether.  Here is the script:

robocopy "%userprofile%\AppData\Local\SAP\SAP Business One" "\\{my server}\TSProfiles\%username%.{my domain}.v2\AppData\Local\SAP\SAP Business One" /s /LOG+:INFO

I want the script to copy the files to the destination and overwrite if they have been modified, but I surely don't want them deleted at the destination if they are not modified.  Like I said earlier, this script works perfectly as long as the files are accessed and/or modified.  Am I using the wrong switch or missing a switch somewhere?
ASKER CERTIFIED SOLUTION
Avatar of Andrew Oakeley
Andrew Oakeley
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks!  Creating a reverse logon script solved the file deletion.