How to force check in after a script completes that is running as logged-in user context?
We have a script that runs as the Logged-in user to adjust or add some regkeys in the Current_User key. The script runs as expected, but we now need the script to force a check-in once completed. Our staff are not admins and because its a Logged-in user script the command to launch the runkbot.exe 4 0 will not run because they do not have permissions. Is there another way to force the check in once this script completes? Any suggestions?
I suggest not to check in after a script for multiple reasons.
You can do multiple things to update the DB and depending on what you want only update partially.
As an example if you have Custom Inventory Rules which need to be updated (I think of a script which adds users or similar and you have CIR to track users) you could do this with
But the main question:
You can create a script as System Service and link the script you want to run and the script to update the DB in a Task Chain
You use a rights evlevation in the script. https://social.technet.microsoft.com/Forums/scriptcenter/en-US/e75b24fb-bb46-480a-9d12-2494d80697cb/how-do-i-make-a-script-quotrun-as-administratorquot-on-its-own is a good example and start for thinking of the process aside of the classic "runas"