locked
Status Filter Rules - PowerShell - Exit Code 4294770688 RRS feed

  • Question

  • I have created a status filter rule to deliver an email for task sequence success (message ID 11171) and failure (message ID 11170). The rule conditions are working based on what I see in the statmgr.log. However, the Run Program action isn't happy with my PowerShell script. This is the output I'm getting:

        Created child process 8144 for program "C:\Windows\System32\WINDOW~1\v1.0\powershell.exe" and command line arguments "-executionpolicy bypass -file D:\Scripts\Success.ps1 -ComputerName client01 -TS "Windows 10 Upgrade"".  Waiting up to 60 seconds for the process to exit...
        The process exited with exit code 4294770688.


    My run program action has the following command. I ran it manually from the primary site server and confirmed that it completes successfully and delivers the email.

    C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -executionpolicy bypass -file D:\Scripts\Success.ps1 -ComputerName %msgsys -TS "Windows 10 Upgrade"

    Any idea what exit code 4294770688 refers to? 



    Thursday, July 27, 2017 11:14 PM

All replies

  • First off did you test the script using the same way cmcb wild execute it? https://verbalprocessor.com/2007/12/05/running-a-cmd-prompt-as-local-system/

    Secondly, what exactly is in the script?


    Garth Jones

    Blog: http://www.enhansoft.com/blog Old Blog: http://smsug.ca/blogs/garth_jones/default.aspx

    Twitter: @GarthMJ Book: System Center Configuration Manager Reporting Unleased

    Friday, July 28, 2017 2:11 AM
  • Great point! Yes - I came to the same conclusion when i was testing the script manually on the site server. I connected via psexec, launched a CMD prompt as system, and copy/pasted the above run program command. The email showed up in my inbox seconds later.
    The PowerShell script just does a basic send-mailmessage, taken from this post: https://www.systemcenterdudes.com/sccm-osd-send-email/
    Friday, July 28, 2017 2:17 AM
  • Great point! Yes - I came to the same conclusion when i was testing the script manually on the site server. I connected via psexec, launched a CMD prompt as system, and copy/pasted the above run program command. The email showed up in my inbox seconds later.
    The PowerShell script just does a basic send-mailmessage, taken from this post: https://www.systemcenterdudes.com/sccm-osd-send-email/

    Then I have no idea. Maybe talk to the author of the script to see what they have to say.

    Garth Jones

    Blog: http://www.enhansoft.com/blog Old Blog: http://smsug.ca/blogs/garth_jones/default.aspx

    Twitter: @GarthMJ Book: System Center Configuration Manager Reporting Unleased

    Friday, July 28, 2017 12:18 PM
  • This is one of the top search engine results so I figured I would add what I came across. 

    In my case I was running a script whose path had spaces in it.  Using single quotes failed with the same error.  Changed it to double quotes and it ran fine.  That suggests that this error indicates a syntax problem but your mileage may vary.

    • Proposed as answer by Mubashir Salim Thursday, November 22, 2018 9:43 AM
    Friday, July 27, 2018 3:06 PM
  • This worked for me. Removing the space from the script path and amending the scheduled task accordingly fixed the error.
    Thursday, November 22, 2018 9:46 AM
  • In case it helps someone else; I was seeing this error because the account used to run the command in MDT didn't have access to the deployment share so it couldn't access the script. 
    Monday, April 15, 2019 12:25 AM