-1

I am trying to create a scheduled task to execute a powershell script in Windows Server 2012 R2. By executing the powershell script, I want to get the log in events and store it in a file. When I trigger the task, the powershell script is executing and creating the file which will store the information but it is not able to fetch the login information from event logs.

When I try to run the task as Administrator, everything works fine.

So, do I need to set any extra permission to fetch log-in information in powershell script, if I create the scheduled task to be executed from Windows Local Service account?

Thanks in Advance.

randomcoder
  • 15
  • 1
  • 9
  • It seems you already have the answer but need confirmation...so yes, set the credentials of the administrator account on the scheduled task and run it.. – Kiran Reddy Dec 04 '15 at 06:06
  • Check to make sure whatever account you use has the local security policy to run batch scripts too. – Nate Dec 04 '15 at 13:08

1 Answers1

0

Yes make sure you're running as administrator or else create the task via the administrator account to your computer. most of the task require the administrator permission to run, for that you can create that that task via admin and add the option "Run whether the user is logged in or not".

Gurumurthy.G
  • 109
  • 3