Hello,
My script, which removes SidHistory using Ashley McGlone's (ie. Goatee PFE) code and updates a SQL table, runs fine from within the PS ISE and as a .ps1 file from the ISE prompt. So I know the code works and the permissions are correct.
I define a Scheduled Task and try to run this same script from a CMD file or the 'Powershell -file' method, with the same permissions I used on the ISE or SYSTEM permissions, and I receive a RC 0 from the script, but the script doesn't run. I know this cause the SidHistory value is still on the User object and data from the commands is not piped to my log files.
Any suggestions on what else to try? How could I trace all statement executions to a file to review?
Thanks for your help! SdeDot