I’ve been working on a project that involves running an executable as system and then running the same executable as the user. Everything works fine for all 39 hosts we’ve attempted to run it on up until the last entry that is the below code:
If {exists file whose(name of it as lowercase contains “.issi”) of folder “c:\program files\issi\Data”}
The application test.consoleprocessor.exe has built in logging that creates a log file after running. This file is not created, though the users group has full control of the directory where it is placed. Also, BigFix logs show that the command ran successfully. There are no logs anywhere that I can find that help me figure out why its not running for some users. Initially my own machine was having this issue and then all of a sudden it started working. I can create a scheduled task as system and have it run the following and it works every time:
I would check if UAC is enabled, that can cause issues with “RunAsCurrentUser”.
Also, are you copying “RunAsCurrentUser.exe” to “program files\issi\QA” ? if not, that could be part of the reason for it failing.
Also if your failures are all on 64bit machines, then your issue may be related to your code silently being redirected to “C:\Program Files (x86)” instead of “C:\Program Files” by windows. Or it could be that it is NOT being redirected, and you are targeting the wrong Program Files folder on 64bit machines (which should cause your If statement to evaluate as false)
if it was UAC, wouldn’t if fail when run from the command line or from a scheduled task? And I thought UAC didn’t effect the system account? Is there anyway of seeing what this tool is doing?
The system account is elevated, but when you use RunAsCurrentUser.exe it will run under the current user’s account and will not be elevated.
Is it happening on 64-bit workstations only? Are you sure a user is logged on when RunAsCurrentUser.exe is called? Did the client log have an exit code next to the message that the line completed successfully?
As a follow up, I pushed a simple echo from a command prompt using run as current user on one of the machines that our other action has not been working on, and that was successful. That confuses me.
shortly after sending the echo, the previous non working action began to work. It hadn’t worked for over a week and it ran 2 times a day. I push another one and all of a sudden it starts working?
Actually no it didn’t start working, was looking at the wrong machine…my brain hurts. it stands as this:
push to user in original post fails and has been for 10 days (excluding weekends). Its ran 2x a day since then.
I push something else using the same runascurrentuser in the same folder but simply creates a txt file in the tmp folder and echos “testing” to it. this works.
Do you know if the failing machines have multiple or remote users logged in? This might cause problems for runascurrentuser.exe (though i have to verify that…)
There should only be one user logged in. I did very ever workstation that was failing does have that error message, but at the same time, I’m getting that error message as well and mine does work. But in the past it wouldn’t work just like the ones that aren’t working now. I don’t know what happened to fix it though.
Upon further investigation, I no longer thing it has anything to do with that error message I noticed in the event viewer. This seems to be related to some accounts that we delete intentionally. I am seeing it on user’s PCs that are running the code successfully as well as users who aren’t running the code successfully. So this leaves us with, runascurrentuser works in one scenario and not another…