Skip to content

TS running SCRIPT

Featured Replies

Hi Guys,

 

I have a issue with running scripts with runas option. We have few custom scripts which needs to run while OSD TS under domain user account to do various function like moving computer object to different OU. If i run the scrip with "Run this step as the following account", the script fails with an error " Incorrect function ". I am not using MDT as the script is not part of MDT. D Also all the scripts are ran using Domain admin account to narrow permission's issue.

Here is the log file for smsts.log:

 

 

Expand a string: WinPEandFullOS TSManager 8/3/2010 3:56:07 PM 1924 (0x0784)

Executing command line: smsswd.exe /run:NSW00028 C:\Windows\system32\cscript.exe C:\_SMSTaskSequence\Packages\NSW00028\MoveToWorkstationOU.vbs TSManager 8/3/2010 3:56:07 PM 1924 (0x0784)

=======================[ smsswd.exe ] ======================= InstallSoftware 8/3/2010 3:56:07 PM 2396 (0x095C)

PackageID = 'NSW00028' InstallSoftware 8/3/2010 3:56:07 PM 2396 (0x095C)

BaseVar = '', ContinueOnError='' InstallSoftware 8/3/2010 3:56:07 PM 2396 (0x095C)

SwdAction = '0001' InstallSoftware 8/3/2010 3:56:07 PM 2396 (0x095C)

Getting linked token InstallSoftware 8/3/2010 3:56:07 PM 2396 (0x095C)

failed to get the token information InstallSoftware 8/3/2010 3:56:07 PM 2396 (0x095C)

Get RunAs private desktop SMSTS-97093\SMSTSDesktop InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

Run command line under a user account InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

DownloadOnDemand flag is true. Attempting to download content locally for Package NSW00028.. InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

Package Flags: 0x44000000 InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

GetDirectoryListing() entered InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

Initializing HTTP transport. InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

Setting URL = http://vs00153.corp.ad.aapt.com.au/SMS_DP_SMSPKGD$/NSW00028/. InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

Address = vs00153.corp.ad.aapt.com.au, Object = /SMS_DP_SMSPKGD$/NSW00028/, Port = 80. InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

WinHttp credentials set InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

CLibSMSMessageWinHttpTransport::Send: URL: vs00153.corp.ad.aapt.com.au:80 PROPFIND /SMS_DP_SMSPKGD$/NSW00028/ InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

Error. Status code 207 returned InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

List of files to be downloaded InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

Directory: http://vs00153.corp.ad.aapt.com.au:80/SMS_DP_SMSPKGD%24/NSW00028/ InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

File: http://vs00153.corp.ad.aapt.com.au:80/SMS_DP_SMSPKGD%24/NSW00028/COEIncludeFile.vbs InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

File: http://vs00153.corp.ad.aapt.com.au:80/SMS_DP_SMSPKGD%24/NSW00028/COEScriptSample.vbs InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

File: http://vs00153.corp.ad.aapt.com.au:80/SMS_DP_SMSPKGD%24/NSW00028/CreateWAGGroup.vbs InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

File: http://vs00153.corp.ad.aapt.com.au:80/SMS_DP_SMSPKGD%24/NSW00028/DeleteDefaultOfflineFilesLocation.vbs InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

File: http://vs00153.corp.ad.aapt.com.au:80/SMS_DP_SMSPKGD%24/NSW00028/MoveOfflineFilesToD.vbs InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

File: http://vs00153.corp.ad.aapt.com.au:80/SMS_DP_SMSPKGD%24/NSW00028/MoveToWorkstationOU.vbs InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

File: http://vs00153.corp.ad.aapt.com.au:80/SMS_DP_SMSPKGD%24/NSW00028/WriteDebugInfoToBuildLog.vbs InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

GetDirectoryListing() successfully completed InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

Succeeded loading resource DLL 'C:\Windows\SysWOW64\CCM\1033\TSRES.DLL' InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

Downloaded file from http://vs00153.corp.ad.aapt.com.au:80/SMS_DP_SMSPKGD%24/NSW00028/COEIncludeFile.vbs to C:\_SMSTaskSequence\Packages\NSW00028\COEIncludeFile.vbs InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

Downloaded file from http://vs00153.corp.ad.aapt.com.au:80/SMS_DP_SMSPKGD%24/NSW00028/COEScriptSample.vbs to C:\_SMSTaskSequence\Packages\NSW00028\COEScriptSample.vbs InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

Downloaded file from http://vs00153.corp.ad.aapt.com.au:80/SMS_DP_SMSPKGD%24/NSW00028/CreateWAGGroup.vbs to C:\_SMSTaskSequence\Packages\NSW00028\CreateWAGGroup.vbs InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

Downloaded file from http://vs00153.corp.ad.aapt.com.au:80/SMS_DP_SMSPKGD%24/NSW00028/DeleteDefaultOfflineFilesLocation.vbs to C:\_SMSTaskSequence\Packages\NSW00028\DeleteDefaultOfflineFilesLocation.vbs InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

Downloaded file from http://vs00153.corp.ad.aapt.com.au:80/SMS_DP_SMSPKGD%24/NSW00028/MoveOfflineFilesToD.vbs to C:\_SMSTaskSequence\Packages\NSW00028\MoveOfflineFilesToD.vbs InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

Downloaded file from http://vs00153.corp.ad.aapt.com.au:80/SMS_DP_SMSPKGD%24/NSW00028/MoveToWorkstationOU.vbs to C:\_SMSTaskSequence\Packages\NSW00028\MoveToWorkstationOU.vbs InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

Downloaded file from http://vs00153.corp.ad.aapt.com.au:80/SMS_DP_SMSPKGD%24/NSW00028/WriteDebugInfoToBuildLog.vbs to C:\_SMSTaskSequence\Packages\NSW00028\WriteDebugInfoToBuildLog.vbs InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

Download done setting progress bar to 100 InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

Content successfully downloaded at C:\_SMSTaskSequence\Packages\NSW00028 InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

Resolved source to 'C:\_SMSTaskSequence\Packages\NSW00028' InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

Command line for extension .exe is "%1" %* InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

Set command line: Run command line InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

Working dir 'C:\_SMSTaskSequence\Packages\NSW00028' InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

Executing command line: Run command line InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

Create a process under given user token InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

Microsoft ® Windows Script Host Version 5.8 InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

Copyright © Microsoft Corporation. All rights reserved. InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

InstallSoftware 8/3/2010 3:56:08 PM 2396 (0x095C)

Process completed with exit code 1 InstallSoftware 8/3/2010 3:56:09 PM 2396 (0x095C)

CScript Error: Can't find script engine "VBScript" for script "C:\_SMSTaskSequence\Packages\NSW00028\MoveToWorkstationOU.vbs". InstallSoftware 8/3/2010 3:56:09 PM 2396 (0x095C)

Command line returned 1 InstallSoftware 8/3/2010 3:56:09 PM 2396 (0x095C)

Entering ReleaseSource() for C:\_SMSTaskSequence\Packages\NSW00028 InstallSoftware 8/3/2010 3:56:09 PM 2396 (0x095C)

reference count 1 for the source C:\_SMSTaskSequence\Packages\NSW00028 before releasing InstallSoftware 8/3/2010 3:56:09 PM 2396 (0x095C)

Delete source directory C:\_SMSTaskSequence\Packages\NSW00028 InstallSoftware 8/3/2010 3:56:09 PM 2396 (0x095C)

Released the resolved source C:\_SMSTaskSequence\Packages\NSW00028 InstallSoftware 8/3/2010 3:56:09 PM 2396 (0x095C)

Process completed with exit code 1 TSManager 8/3/2010 3:56:09 PM 1924 (0x0784)

!--------------------------------------------------------------------------------------------! TSManager 8/3/2010 3:56:09 PM 1924 (0x0784)

Failed to run the action: Move to OU.

Incorrect function. (Error: 00000001; Source: Windows) TSManager 8/3/2010 3:56:09 PM 1924 (0x0784)

Sending status message . . . TSManager 8/3/2010 3:56:09 PM 1924 (0x0784)

Send a task execution status message SMS_TSExecution_ActionFailError TSManager 8/3/2010 3:56:09 PM 1924 (0x0784)

MP server VS00152.CORP.AD.AAPT.COM.AU and port 80. SSL=false. CRL=false. TSManager 8/3/2010 3:56:09 PM 1924 (0x0784)

Site code: NSW TSManager 8/3/2010 3:56:09 PM 1924 (0x0784)

Client machine name: lt004 TSManager 8/3/2010 3:56:09 PM 1924 (0x0784)

Client Identity: GUID:14C1A116-E25A-41DB-AD88-3CD9D970E074 TSManager 8/3/2010 3:56:09 PM 1924 (0x0784)

Advertisement ID: NSW2000B TSManager 8/3/2010 3:56:09 PM 1924 (0x0784)

Package ID: NSW0002A TSManager 8/3/2010 3:56:09 PM 1924 (0x0784)

Sending StatusMessage TSManager 8/3/2010 3:56:09 PM 1924 (0x0784)

Formatted header: TSManager 8/3/2010 3:56:09 PM 1924 (0x0784)

<Msg SchemaVersion="1.1" ReplyCompression="zlib"><ID/><SourceID>02F21464-ECD3-4D19-ABAF-F250B6488C66</SourceID><SourceHost/><TargetAddress>mp:[http]MP_StatusManager</TargetAddress><ReplyTo>direct:OSD</ReplyTo><Priority>3</Priority><Timeout>3600</Timeout><SentTime>2010-08-03T05:56:09Z</SentTime><Protocol>http</Protocol><Body Type="ByteRange" Offset="0" Length="4172"/><Hooks/><Payload Type="inline"/><TargetHost/><TargetEndpoint>StatusReceiver</TargetEndpoint><ReplyMode>Sync</ReplyMode><CorrelationID/></Msg>

TSManager 8/3/2010 3:56:09 PM 1924 (0x0784)

CLibSMSMessageWinHttpTransport::Send: URL: VS00152.CORP.AD.AAPT.COM.AU:80 CCM_POST /ccm_system/request TSManager 8/3/2010 3:56:09 PM 1924 (0x0784)

The request has succeeded. 200 OK TSManager 8/3/2010 3:56:09 PM 1924 (0x0784)

Set a global environment variable _SMSTSLastActionRetCode=1 TSManager 8/3/2010 3:56:10 PM 1924 (0x0784)

Set a global environment variable _SMSTSLastActionSucceeded=false TSManager 8/3/2010 3:56:10 PM 1924 (0x0784)

Clear local default environment TSManager 8/3/2010 3:56:10 PM 1924 (0x0784)

Let the parent group (Environment Scripts) decides whether to continue execution TSManager 8/3/2010 3:56:10 PM 1924 (0x0784)

The execution of the group (Environment Scripts) has failed and the execution has been aborted. An action failed.

Operation aborted (Error: 80004004; Source: Windows) TSManager 8/3/2010 3:56:10 PM 1924 (0x0784)

Failed to run the last action: Move to OU. Execution of task sequence failed.

Incorrect function. (Error: 00000001; Source: Windows) TSManager 8/3/2010 3:56:10 PM 1924 (0x0784)

Sending status message . . . TSManager 8/3/2010 3:56:10 PM 1924 (0x0784)

Send a task execution status message SMS_TSExecution_TaskSequenceFailError TSManager 8/3/2010 3:56:10 PM 1924 (0x0784)

MP server VS00152.CORP.AD.AAPT.COM.AU and port 80. SSL=false. CRL=false. TSManager 8/3/2010 3:56:10 PM 1924 (0x0784)

Site code: NSW TSManager 8/3/2010 3:56:10 PM 1924 (0x0784)

Client machine name: lt004 TSManager 8/3/2010 3:56:10 PM 1924 (0x0784)

Client Identity: GUID:14C1A116-E25A-41DB-AD88-3CD9D970E074 TSManager 8/3/2010 3:56:10 PM 1924 (0x0784)

Advertisement ID: NSW2000B TSManager 8/3/2010 3:56:10 PM 1924 (0x0784)

Package ID: NSW0002A TSManager 8/3/2010 3:56:10 PM 1924 (0x0784)

Sending StatusMessage TSManager 8/3/2010 3:56:10 PM 1924 (0x0784)

Formatted header: TSManager 8/3/2010 3:56:10 PM 1924 (0x0784)

<Msg SchemaVersion="1.1" ReplyCompression="zlib"><ID/><SourceID>02F21464-ECD3-4D19-ABAF-F250B6488C66</SourceID><SourceHost/><TargetAddress>mp:[http]MP_StatusManager</TargetAddress><ReplyTo>direct:OSD</ReplyTo><Priority>3</Priority><Timeout>3600</Timeout><SentTime>2010-08-03T05:56:10Z</SentTime><Protocol>http</Protocol><Body Type="ByteRange" Offset="0" Length="2086"/><Hooks/><Payload Type="inline"/><TargetHost/><TargetEndpoint>StatusReceiver</TargetEndpoint><ReplyMode>Sync</ReplyMode><CorrelationID/></Msg>

TSManager 8/3/2010 3:56:10 PM 1924 (0x0784)

CLibSMSMessageWinHttpTransport::Send: URL: VS00152.CORP.AD.AAPT.COM.AU:80 CCM_POST /ccm_system/request TSManager 8/3/2010 3:56:10 PM 1924 (0x0784)

The request has succeeded. 200 OK TSManager 8/3/2010 3:56:10 PM 1924 (0x0784)

Launching command shell. OSDSetupHook 8/3/2010 4:00:22 PM 1872 (0x0750)

Windows station: WinSta0 OSDSetupHook 8/3/2010 4:00:22 PM 1872 (0x0750)

Desktop: Default OSDSetupHook 8/3/2010 4:00:22 PM 1872 (0x0750)

executing command: C:\Windows\system32\cmd.exe /k OSDSetupHook 8/3/2010 4:00:22 PM 1872 (0x0750)

executed command: C:\Windows\system32\cmd.exe /k OSDSetupHook 8/3/2010 4:00:22 PM 1872 (0x0750)

Execution::enExecutionFail != m_eExecutionResult, HRESULT=80004005 (e:\nts_sms_fre\sms\client\tasksequence\tsmanager\tsmanager.cpp,767) TSManager 8/3/2010 4:00:35 PM 1924 (0x0784)

Task Sequence Engine failed! Code: enExecutionFail TSManager 8/3/2010 4:00:35 PM 1924 (0x0784)

**************************************************************************** TSManager 8/3/2010 4:00:35 PM 1924 (0x0784)

Task sequence execution failed with error code 80004005 TSManager 8/3/2010 4:00:35 PM 1924 (0x0784)

 

Any help will be appreatiated.

  • Author

Guyssssss anyone.........rerally need to resolve this issue

CScript Error: Can't find script engine "VBScript" for script "C:\_SMSTaskSequence\Packages\NSW00028\MoveToWorkstationOU.vbs". InstallSoftware 8/3/2010 3:56:09 PM 2396 (0x095C)

 

 

This is proberbly what goes wrong. How does you commandline look?

  • Author

CScript Error: Can't find script engine "VBScript" for script "C:\_SMSTaskSequence\Packages\NSW00028\MoveToWorkstationOU.vbs". InstallSoftware 8/3/2010 3:56:09 PM 2396 (0x095C)

 

 

This is proberbly what goes wrong. How does you commandline look?

 

Thanks for the reply. Please see the screen shot of my TS step. I have done different methods of running the script but all fail with the same error. I have tired cmd.exe /c "cscript.exe script name" cscript scriptname. I know this should work but I am making a mistake somewhere. Also attached is the TS xml.

post-5883-12808988279057_thumb.jpg

TS_Microsoft.xml

  • 7 months later...

We use a similar method for moving the Computer Object after the build stage

 

the command line should be like this

 

cscript.exe "name of script file.vbs"

 

We have an issue moving an existing computer account before the Image is deployed. Has anyone got a working script for Windows PE to move the computer account?

  • 5 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.