Windows Server 2008 R2, SP1
Domain Controller
SCOM 2012 R2, fully patched
On this one server, all WSH scripts run by the monitoring agent (vbs, js, etc.) fail with event 21405. They all return the same process exit code 3221225794, which is Application Failed to Initialize. WSH scripts run correctly interactively.
I have scoured the forums and tried the most common fixes, like bad file associations, etc.
Upon investigation, I found something curious. If I run CSCRIPT my domain admin account, it will work. But, if I use psexec -s to run it as the SYSTEM account, it will exit and return no output. To make sure this wasn't an artifact of psexec,
I did the same thing on another domain controller and the script ran fine. To be clear, I cannot get CSCRIPT to even show its splash screen or version number when running as system. It's not just that it won't run scripts, it doesn't seem to be
running at all. I think this is where my problem is, but I've exhausted everything I can think of and can't figure out why system can't run CSCRIPT. My guess is something in the system account's user profile, but what?
Example failing script. Note, there are thousands of these errors every few minutes. It's not worth posting more than one. The only difference is the script name.
The process started at 6:58:33 PM failed to create System.Discovery.Data, no errors detected in the output. The process exited with 3221225794
Command executed: "C:\Windows\system32\cscript.exe" /nologo "DiscoverHealthServiceCommunicationRelationships.js" 0 {3237253B-2A1C-38E7-8E52-588635224D35} {BEC2C24C-ADD4-A9B8-254E-B4F8A170013A} DC2.mydomain.com "OpsMgr-Main"
Working Directory: C:\Program Files\Microsoft Monitoring Agent\Agent\Health Service State\Monitoring Host Temporary Files 7\5771\
One or more workflows were affected by this.
Workflow name: Microsoft.SystemCenter.DiscoveryHealthServiceCommunication
Instance name: DC2.mydomain.com
Instance ID: {BEC2C24C-ADD4-A9B8-254E-B4F8A170013A}
Management group: OpsMgr-Main
CSCRIPT output when run as domain admin:
C:\Windows\System32>cscript.exe
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.
Usage: CScript scriptname.extension [option...] [arguments...]
Options:
//B Batch mode: Suppresses script errors and prompts from displaying
//D Enable Active Debugging
//E:engine Use engine for executing script
//H:CScript Changes the default script host to CScript.exe
//H:WScript Changes the default script host to WScript.exe (default)
//I Interactive mode (default, opposite of //B)
//Job:xxxx Execute a WSF job
//Logo Display logo (default)
//Nologo Prevent logo display: No banner will be shown at execution time
//S Save current command line options for this user
//T:nn Time out in seconds: Maximum time a script is permitted to run
//X Execute script in debugger
//U Use Unicode for redirected I/O from the console
C:\Windows\System32>
CSCRIPT when run as SYSTEM
C:\Windows\System32>cscript.exe
C:\Windows\System32>