Task Scheduler error message calling Powershell script

Posted on 2008-11-14
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).
Question by:nhough
    1 Comment
    LVL 18

    Accepted Solution

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Learn about cloud computing and its benefits for small business owners.
    A Bare Metal Image backup allows for the restore of an entire system to a similar or dissimilar hardware. They are highly useful for migrations and disaster recovery. Bare Metal Image backups support Full and Incremental backups. Differential backup…
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now