Answered by:
Scheduled Task PowerShell Script Issue

Question
-
Hi All, I'm having a weird powershell issue on two Windows Server 2012 machines and hopefully someone can help me out. I have a powershell script called test.ps1 with "$tst = 1" inside of it. I've setup a scheduled task to run test.ps1 as the local system account and it works fine when the test.ps1 file is located on the root of C, D and E drive. The problem is when I change the account to run as a domain account (that has local administrator permissions) the task works fine when the test.ps1 file is located on the root of C drive but fails when located on the root of D or E drive. When I run the task I can see the powershell process start and stop, but it doesn't do anything and task scheduler returns (0x80070001) as the run result. I can manually login with that account and manually run the test.ps1 powershell file and it works fine on the root of C, D and E drive. Any ideas?Monday, March 11, 2013 5:06 AM
Answers
-
Just letting everyone know that I have found the issue and the fix can be found here: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1012225
Thanks, Boony.
Monday, March 11, 2013 10:22 PM
All replies
-
Are elevated rights set?
You can run Process Monitor to catch the critical point.
M.
Monday, March 11, 2013 12:51 PM -
I have set the execution policy to unrestricted in both of the 32 and 64 bit powershell processes. UAC is disabled and the account is a local administrator. What more elevated rights could be set?
I've tried running process monitor and the powershell process starts and runs for a little while but there are no "access denied" results or any good reason why powershell doesn't run the script.
Monday, March 11, 2013 9:03 PM -
Just letting everyone know that I have found the issue and the fix can be found here: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1012225
Thanks, Boony.
Monday, March 11, 2013 10:22 PM -