You'll have to create a batch file to call \program files\landesk\ldclient\STARTASUSER.exe. This will run any file as the locally logged on user. This will help you:
1.create a .bat file to import the registry key file on the client, suppose this registry key file is named "Myfile.reg"
2.Create bat file, please refer the following script:
regedit /s Myfile.reg
the "Myfile.reg" file as an additional file so that we don't need to
specify the path of "Myfile.reg" in the batch file. The .reg file will
be downloaded to the same location as the .bat file in the SDMCACHE
directory on the client.
4. Schedule the task on target client machine.
Registry changes made as local system will not touch the
HKEY_CURRENT_USER hive. If the registry key to be imported is in the
HKEY_CURRENT_USER hive, then local system will not be able to make the
change. Use the runasuser.exe instead to import a user specific
Message was edited by: Jed
The spaces didn't show for me... Hopefully fixed.
Edit your post and delete all the useless spaces.
Put the batch file surrounded by code tags:
Your batch file
1 of 1 people found this helpful
This is actually one of the few reasons to still use package builder (though package builder doesn't work on Vista)
It has a nice registry tool that has an option to apply to "All users" so any user that has ever logged in will get the registry key in their HKCU.
Perhaps it is better to use the STARTASUSER.EXE command given from LANDesk under %programfiles%\LANDesk\LDClient with the associated switches, most likley ///silent.
But the problem will be that the User currently logged on needs local admin rights to write into the registry.
Another method would be the shareware tool runaspc.exe there you are able to give the right user and a password for this user and the user isn't able to get the password. Until now I don't have any experience with the runaspc.exe, I only know this tool exists.
For that issue there's a lot of testing required.
Users should have full rights to HKCU. Also I think if you just write the key to the .default portion it will carry down to all new users (I think this is what PB does). Since PB is on its death bed, there are a couple of Autoit functions that work very well (can be used for HKLM where rights may be an issue and Startasuser will not work).
Seconding the suggestion for STARTASUSER - you can then launch a batch/script whatever, and ensure it'll run in user context.
The only thing to watch out for is not to launch this job while no-one is logged on to the machine (where I seem to recall STARTASUSER simply falls back to the LOCAL SYSTEM account - hence modifying the HKLM registry hive).
But if you make this as a policy for users (for instance), then using STARTASUSER will definitely make your life easier to ensure that this will get launched in the right user's context :).
LANDesk EMEA Technical Lead
I cannot believe I am saying this, but Package Builder, in this instance, is probably a better solution for XP (NOT VISTA) than StartAsUser.exe.
StartAsUser.exe has two limitations.
It can only change/add the Registry key for one user at a time.
It can only change/add the Registry key if the user is logged in.
So if there are five or more users who use the same machine, the package would have to run 5 times, once when each separate user is logged in. Some sites (Call centers) do not have set computers and a different user could log into a computer every day.
Package builder can add a registry so simply.
This little configuration adds a new Registry Key called "New Key".
It creates one DWORD called Smile that is set to a value of 1.
BEGINREGISTRY KEY: new, "HKEY_CURRENT_USER\Software\New Key" VALUE: reg_dword, new, "Smile", "1" ENDREGISTRY
This will work on XP, 2000/2003, ME, 9x. It will work regardless of who is logged in. It has only one problem, it will not run on Vista.
Many thanks to all who answered my question. We tried the Package Builder method and found that it worked a treat. This was my first experience using the LANDesk community and found all the responses top notch. Thanks again to all.
LANDesk Management Suite 8.8 provides the ability to run packages as the logged on user without using the startasuser.exe application, it is built right into the GUI. You can set this on the distribution package properties. You can either set the package to run as Local Syste (as it always has) or as the current user's account.
Another way to do updates to new and existing users' profile folders and/or HKCU is to use Active Setup. Active Setup is the mechanism the Microsoft uses to update user specific items for their applications (i.e. Internet Explorer, Media Player, etc) that have many user specific settings. We've used it many times and it's been a lifesaver and is basically set and forget. The best part is that it doesn't matter if the person logging in is an existing user or a brand new user. Active setup will run once, and only once for each user.
See the following for a great explanation on using Active Setup.
there's one more limitation that I found: you cannot run something that is located on a server, whatever you're going to run has to be a local file
for example, this won't work: push a batch file via SWD that looks like this:
I could be wrong, because I just started testing using startasuser, but it wouldn work for me
That should be a permissions issue and not a limitation of StartAsUser.exe.
I meant that as more of a tip ... I don't think it's a problem with startasuser.