none
Powershell script failure 10904 2A98 RRS feed

  • Question

  • Greetings,

      I have some powershell scripts that work fine during WinPE and at the end of the OS phase of my MDT deployment. I wanted to test a change to a powershell script so I created a small TS and deployed it to an already running Windows 7 system . The powershell script fails with return code 10904. There is no log message indicating what might be wrong - just rc = 10904. Surely it cannot be the executionpolicy as I understand MDT runs under unrestricted. I have tried a variety of powershell scripts even with basic one liners. All powershell scripts, no matter what's in them, are failing when deployed to an existing OS. So what would be the missing piece in an existing OS deployment, given that PS scripts run fine during the standard OSD deployment?

    Thanks

    David Z

    Friday, August 22, 2014 12:08 AM

All replies

  • How are you calling the powershell scripts? are you calling them directly as steps in the task sequence?

    powershell %scriptroot%\do-something.ps1

    if so, yes, you won't get any debugging output from the powershell script.

    Instead, I recommend calling powershell scripts from the built-in MDT powershell wapper. It should do a better job of capturing powershell output to the bdd.log file for later analysis.

    From the Task Sequence Editor --> Add --> General --> Run Powershell Script


    Keith Garner - Principal Consultant [owner] - http://DeploymentLive.com

    Friday, August 22, 2014 3:42 AM
    Moderator
  • Thanks. I am using the Run Powershell script wrapper.

    Cheers

    David Z

    Friday, August 22, 2014 3:45 AM
  • What does the bdd.log file show? :^)

    Keith Garner - Principal Consultant [owner] - http://DeploymentLive.com

    Friday, August 22, 2014 5:02 AM
    Moderator
  • No BDD.log

    When the TS finishes, it updates the smsts.log in c:\windows\ccm\logs, but the bdd.log still has only the original OSD stuff.

    Friday, August 22, 2014 5:16 AM
  • No, that can't be right...can you post the smsts.log file to a public site like OneDrive?


    Keith Garner - Principal Consultant [owner] - http://DeploymentLive.com

    Friday, August 22, 2014 5:21 AM
    Moderator
  • The smsts.log doesnt give a clue. Just rc = 10904 - absolutely no other error messages.
    Friday, August 22, 2014 5:23 AM
  • Oh there are plenty of clues from a smsts.log file. Like what command line was called.

    Keith Garner - Principal Consultant [owner] - http://DeploymentLive.com

    Friday, August 22, 2014 5:25 AM
    Moderator
  • Here is the step from smsts.log:

    <![LOG[Start executing an instruction. Instruction name: Set OSDTime. Instruction pointer: 4]LOG]!><time="15:13:30.417-600" date="08-22-2014" component="TSManager" context="" type="1" thread="3740" file="engine.cxx:116">
    <![LOG[Set a global environment variable _SMSTSCurrentActionName=Set OSDTime]LOG]!><time="15:13:30.417-600" date="08-22-2014" component="TSManager" context="" type="0" thread="3740" file="executionenv.cxx:668">
    <![LOG[Set a global environment variable _SMSTSNextInstructionPointer=4]LOG]!><time="15:13:30.417-600" date="08-22-2014" component="TSManager" context="" type="0" thread="3740" file="executionenv.cxx:668">
    <![LOG[Set a local default variable Parameters]LOG]!><time="15:13:30.418-600" date="08-22-2014" component="TSManager" context="" type="0" thread="3740" file="executionenv.cxx:700">
    <![LOG[Set a local default variable ScriptName]LOG]!><time="15:13:30.419-600" date="08-22-2014" component="TSManager" context="" type="0" thread="3740" file="executionenv.cxx:700">
    <![LOG[Set a global environment variable _SMSTSLogPath=C:\WINDOWS\CCM\Logs\SMSTSLog]LOG]!><time="15:13:30.419-600" date="08-22-2014" component="TSManager" context="" type="0" thread="3740" file="executionenv.cxx:668">
    <![LOG[Expand a string: smsswd.exe /run: cscript.exe %DeployRoot%\Scripts\ZTIPowerShell.wsf]LOG]!><time="15:13:30.419-600" date="08-22-2014" component="TSManager" context="" type="0" thread="3740" file="executionenv.cxx:782">
    <![LOG[Expand a string: ]LOG]!><time="15:13:30.419-600" date="08-22-2014" component="TSManager" context="" type="0" thread="3740" file="executionenv.cxx:782">
    <![LOG[Start executing the command line: smsswd.exe /run: cscript.exe %DeployRoot%\Scripts\ZTIPowerShell.wsf]LOG]!><time="15:13:30.420-600" date="08-22-2014" component="TSManager" context="" type="1" thread="3740" file="instruction.cxx:722">
    <![LOG[!--------------------------------------------------------------------------------------------!]LOG]!><time="15:13:30.420-600" date="08-22-2014" component="TSManager" context="" type="1" thread="3740" file="instruction.cxx:751">
    <![LOG[Expand a string: WinPEandFullOS]LOG]!><time="15:13:30.420-600" date="08-22-2014" component="TSManager" context="" type="0" thread="3740" file="executionenv.cxx:782">
    <![LOG[Executing command line: smsswd.exe /run: cscript.exe %DeployRoot%\Scripts\ZTIPowerShell.wsf]LOG]!><time="15:13:30.420-600" date="08-22-2014" component="TSManager" context="" type="1" thread="3740" file="commandline.cpp:827">
    <![LOG[[ smsswd.exe ]]LOG]!><time="15:13:30.428-600" date="08-22-2014" component="InstallSoftware" context="" type="1" thread="1152" file="main.cpp:289">
    <![LOG[PackageID = '']LOG]!><time="15:13:30.430-600" date="08-22-2014" component="InstallSoftware" context="" type="1" thread="1152" file="main.cpp:318">
    <![LOG[BaseVar = '', ContinueOnError='']LOG]!><time="15:13:30.430-600" date="08-22-2014" component="InstallSoftware" context="" type="1" thread="1152" file="main.cpp:319">
    <![LOG[ProgramName = 'cscript.exe D:\_SMSTaskSequence\WDPackage\Scripts\ZTIPowerShell.wsf']LOG]!><time="15:13:30.430-600" date="08-22-2014" component="InstallSoftware" context="" type="1" thread="1152" file="main.cpp:320">
    <![LOG[SwdAction = '0001']LOG]!><time="15:13:30.430-600" date="08-22-2014" component="InstallSoftware" context="" type="1" thread="1152" file="main.cpp:321">
    <![LOG[Working dir 'not set']LOG]!><time="15:13:30.437-600" date="08-22-2014" component="InstallSoftware" context="" type="1" thread="1152" file="runcommandline.cpp:546">
    <![LOG[Executing command line: Run command line]LOG]!><time="15:13:30.437-600" date="08-22-2014" component="InstallSoftware" context="" type="1" thread="1152" file="commandline.cpp:827">
    <![LOG[Microsoft (R) Windows Script Host Version 5.8]LOG]!><time="15:13:30.688-600" date="08-22-2014" component="InstallSoftware" context="" type="1" thread="1152" file="runcommandline.cpp:34">
    <![LOG[Copyright (C) Microsoft Corporation. All rights reserved.]LOG]!><time="15:13:30.688-600" date="08-22-2014" component="InstallSoftware" context="" type="1" thread="1152" file="runcommandline.cpp:34">
    <![LOG[]LOG]!><time="15:13:30.688-600" date="08-22-2014" component="InstallSoftware" context="" type="1" thread="1152" file="runcommandline.cpp:34">
    <![LOG[Microsoft Deployment Toolkit version: 6.2.5019.0]LOG]!><time="15:13:30.688-600" date="08-22-2014" component="InstallSoftware" context="" type="1" thread="1152" file="runcommandline.cpp:34">
    <![LOG[The task sequencer log is located at C:\WINDOWS\CCM\Logs\SMSTSLog\SMSTS.LOG.  For task sequence failures, please consult this log.]LOG]!><time="15:13:30.688-600" date="08-22-2014" component="InstallSoftware" context="" type="1" thread="1152" file="runcommandline.cpp:34">
    <![LOG[PowerShell version detected: 4.0]LOG]!><time="15:13:30.688-600" date="08-22-2014" component="InstallSoftware" context="" type="1" thread="1152" file="runcommandline.cpp:34">
    <![LOG[About to run: "D:\_SMSTaskSequence\WDPackage\Tools\Modules\Microsoft.BDD.TaskSequenceModule\Microsoft.BDD.TaskSequencePSHost40.exe" "C:\OSD\Scripts\Set-OSDTime.ps1" "D:\MININT\SMSOSD\OSDLOGS" ]LOG]!><time="15:13:30.688-600" date="08-22-2014" component="InstallSoftware" context="" type="1" thread="1152" file="runcommandline.cpp:34">
    <![LOG[Process completed with exit code 10904]LOG]!><time="15:13:30.797-600" date="08-22-2014" component="InstallSoftware" context="" type="1" thread="1152" file="commandline.cpp:1123">
    <![LOG[ZTI ERROR - Non-zero return code by ZTIPowerShell, rc = 10904]LOG]!><time="15:13:30.797-600" date="08-22-2014" component="InstallSoftware" context="" type="1" thread="1152" file="runcommandline.cpp:34">
    <![LOG[Command line returned 10904]LOG]!><time="15:13:30.797-600" date="08-22-2014" component="InstallSoftware" context="" type="1" thread="1152" file="runcommandline.cpp:569">
    <![LOG[Process completed with exit code 10904]LOG]!><time="15:13:30.800-600" date="08-22-2014" component="TSManager" context="" type="1" thread="3740" file="commandline.cpp:1123">
    <![LOG[!--------------------------------------------------------------------------------------------!]LOG]!><time="15:13:30.800-600" date="08-22-2014" component="TSManager" context="" type="1" thread="3740" file="instruction.cxx:804">
    <![LOG[Failed to run the action: Set OSDTime. 
    Unknown error (Error: 00002A98; Source: Unknown)]LOG]!><time="15:13:30.801-600" date="08-22-2014" component="TSManager" context="" type="3" thread="3740" file="instruction.cxx:895">
    <![LOG[Set authenticator in transport]LOG]!><time="15:13:30.802-600" date="08-22-2014" component="TSManager" context="" type="0" thread="3740" file="libsmsmessaging.cpp:7734">
    <![LOG[Set a global environment variable _SMSTSLastActionRetCode=10904]LOG]!><time="15:13:31.068-600" date="08-22-2014" component="TSManager" context="" type="0" thread="3740" file="executionenv.cxx:668">
    <![LOG[Set a global environment variable _SMSTSLastActionSucceeded=false]LOG]!><time="15:13:31.069-600" date="08-22-2014" component="TSManager" context="" type="0" thread="3740" file="executionenv.cxx:668">
    <![LOG[Clear local default environment]LOG]!><time="15:13:31.069-600" date="08-22-2014" component="TSManager" context="" type="0" thread="3740" file="executionenv.cxx:807">
    <![LOG[Failed to run the action: Set OSDTime. Execution has been aborted]LOG]!><time="15:13:31.071-600" date="08-22-2014" component="TSManager" context="" type="3" thread="3740" file="instruction.cxx:983">
    <![LOG[Set authenticator in transport]LOG]!><time="15:13:31.073-600" date="08-22-2014" component="TSManager" context="" type="0" thread="3740" file="libsmsmessaging.cpp:7734">
    <![LOG[Failed to run the last action: Set OSDTime. Execution of task sequence failed.
    Unknown error (Error: 00002A98; Source: Unknown)]LOG]!><time="15:13:31.354-600" date="08-22-2014" component="TSManager" context="" type="3" thread="3740" file="engine.cxx:213">
    <![LOG[Set authenticator in transport]LOG]!><time="15:13:31.358-600" date="08-22-2014" component="TSManager" context="" type="0" thread="3740" file="libsmsmessaging.cpp:7734">
    <![LOG[Task Sequence Engine failed! Code: enExecutionFail]LOG]!><time="15:14:00.200-600" date="08-22-2014" component="TSManager" context="" type="3" thread="3740" file="tsmanager.cpp:923">
    <![LOG[****************************************************************************]LOG]!><time="15:14:00.200-600" date="08-22-2014" component="TSManager" context="" type="1" thread="3740" file="tsmanager.cpp:953">
    <![LOG[Task sequence execution failed with error code 80004005]LOG]!><time="15:14:00.201-600" date="08-22-2014" component="TSManager" context="" type="3" thread="3740" file="tsmanager.cpp:954">
    <![LOG[Cleaning Up.]LOG]!><time="15:14:00.211-600" date="08-22-2014" component="TSManager" context="" type="1" thread="3740" file="tsmanager.cpp:675">
    <![LOG[Removing Authenticator]LOG]!><time="15:14:00.211-600" date="08-22-2014" component="TSManager" context="" type="1" thread="3740" file="tsmanager.cpp:686">

    Sunday, August 24, 2014 9:56 PM
  • Here is the step from smsts.log:

    About to run: "D:\_SMSTaskSequence\WDPackage\Tools\Modules\Microsoft.BDD.TaskSequenceModule\Microsoft.BDD.TaskSequencePSHost40.exe" "C:\OSD\Scripts\Set-OSDTime.ps1" "D:\MININT\SMSOSD\OSDLOGS"
    Process completed with exit code 10904

    Exit code 10904 means that Microsoft.BDD.TaskSequencePSHost40.exe had an unexpected exception. What I'm not quite sure, could be missing the Microsoft.BDD.TaskSequenceModule.psd1 file.

    One of the tricks to get to the bottom of the problem is to use the DebugView.exe tool from Sysinternals, while the Microsoft.BDD.TaskSequencePSHost40.exe process is running, we could get a better view as to what is going on. If the script started running, the bdd.log file should be at d:\MININT\SMSOSD\OSDLOGS (2nd parameter to pshost.


    Keith Garner - Principal Consultant [owner] - http://DeploymentLive.com

    Monday, August 25, 2014 6:23 PM
    Moderator
  • Has anybody found a solution to this?  i have MDT 6.2.5019.0.  I have 'PowerShell' selected in my x64> features in my Windows 8.1 Enterprise x64 Deployment share. and none of my powershell scripts run. ive added them as follows: on the Task Sequence Editor --> Add --> General --> Run Powershell Script.  Yet i keep gettin ZTI Error - Non-zero return code by ZTIPowerShell rc = 10904.   i have a seperate Windows 7 x64 Enterprise deployment share and i have no issues running Powershell scripts from the task sequence.  Any ideas what this could be?
    Monday, March 2, 2015 5:03 PM
  • the only thing i could think of that may be causing the issue is that i upgraded my windows 8.1 enterprise x64 base image with Powershell 4.0.  but i also did the same for my windows 7 x64 Enterprise base image and i get no errors.  I'm pretty sure this is a bug in MDT.  but im not sure.   could any one help me?
    EDIT: i also recreated the MDT .WIM completely instead of optimizing it.

    • Edited by PCman22 Monday, March 2, 2015 7:20 PM
    Monday, March 2, 2015 7:18 PM
  • Has anybody found a solution to this?  i have MDT 6.2.5019.0.  I have 'PowerShell' selected in my x64> features in my Windows 8.1 Enterprise x64 Deployment share. and none of my powershell scripts run. ive added them as follows: on the Task Sequence Editor --> Add --> General --> Run Powershell Script.  Yet i keep gettin ZTI Error - Non-zero return code by ZTIPowerShell rc = 10904.   i have a seperate Windows 7 x64 Enterprise deployment share and i have no issues running Powershell scripts from the task sequence.  Any ideas what this could be?

    Start a new thread with details about your specific problem.

    What specific steps got you to this error?

    Post your BDD.log and smsts.log s or interesting tidbits from the logs will be useful.

    Without specific details it all just guessing on our part.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Monday, March 2, 2015 9:19 PM
    Moderator
  • ok thanks ty Glander ill start a new thread
    Monday, March 2, 2015 9:23 PM