?
Solved

Task Scheduler error message calling Powershell script

Posted on 2008-11-14
2
Medium Priority
?
1,566 Views
Last Modified: 2012-05-05
I am trying to schedule a powershell script to run via the task manager.  When I run the script alone - it executes fine.

Here is the contents of the RUN command via the Windows Scheduler:

C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -PSConsoleFile "d:\Program Files\Microsoft\Exchange Server\Bin\exshell.psc1" -command E:\scripts\eventlog.ps1

When I try to run the task manually I get the following error:
Result: The task completed with an exit code of (fffc0000).
0
Comment
Question by:nhough
1 Comment
 
LVL 18

Accepted Solution

by:
BSonPosh earned 500 total points
ID: 22967343
Instead of adding the console file... add this line to the top of your script

get-pssnapin -reg | add-pssnapin -ea 0

Also make sure the account you use for the task has the proper Exchange rights.
0

Featured Post

A Cyber Security RX to Protect Your Organization

Join us on December 13th for a webinar to learn how medical providers can defend against malware with a cyber security "Rx" that supports a healthy technology adoption plan for every healthcare organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post, I will showcase the steps for how to create groups in Office 365. Office 365 groups allow for ease of flexibility and collaboration between staff members.
Measuring Server's processing rate with a simple powershell command. The differences in processing rate also was recorded in different use-cases, when a server in free and busy states.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month13 days, 18 hours left to enroll

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question