Some registry keys are owned by TrustedInstaller. With a workaround you can change registry keys that are 'protected' by TrustedInstaller. This involves creating a .bat file and running this with the RunFromToken program. This is a bit of a hassle.
Running a registry section elevated or with trustedinstaller credentials might prevent messages like this in the logfile, as these happen quite often:
/RunElevated means that opsi-script will start a sub process with a special permission token. This token increase some rights but also restrict some other (e.g. network access).
So it is not possible to just call a winapi function with elevated rights.
I do not expect that there will be a possibility to call a registry section elevated in the near future.
Workaround:
If you want to do this you need a separate program that calls this winapi function and than start this program with an elevated token.
Therefore it is possible to use a processsCall function or winbatch section with /runElevated (which is internally the same) and call the reg.exe program with command line parameters to manipulate the registry elevated.
There are some feature requests for /runElevated for shellInAnIcon / shellCall / Execwith.
This is possible because a sub process will be started here.
But it will take a while because the implementation is totally different here.
cheers
detlef
Vielen Dank für die Nutzung von opsi. Im Forum ist unser Support begrenzt.
Für den professionellen Einsatz und individuelle Beratung empfehlen wir einen Support-Vertrag und eine Schulung. Gerne informieren wir Sie zu unserem Angebot.
d.oertel hat geschrieben:
Therefore it is possible to use a processsCall function or winbatch section with /runElevated (which is internally the same) and call the reg.exe program with command line parameters to manipulate the registry elevated.
I'm not sure why I didn't think of that. Oh wait, probably because I also have stuff to do for every user.
Anyway, it might be workable like that (with winbatch). If you have to create a batch file every step this will make a script a bit longer, and more important, less readable. That's why a /RunElevated for the registry would be nice; everything for the registry is in the same section.
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!