I have a batch file that I use to collect the SID of the current user and store in a file for later use by another script. The batch file runs fine from the command prompt on both WinXP and Win7. The batch file executes properly when run from an agent proceedure on WinXP, but does not run on Win7 from the same proceedure.
I initially tried executing shell command as the logged in user, but then tried everything else I could think of (execute file, etc as the logged in user) without success.
Found my own answer.
Something in windows 7 didn't like a couple parameters for a loop in the batch file when executed through kaseya. I found a powershell command to perform the same function.
powershell ([Security.Principal.WindowsIdentity]::GetCurrent()).User.Value >>#vAgentConfiguration.AgentTempDir#\SID2.txt