Task Sequence - Cannot create ActiveX component
Hi All, I’m trying to figure out a rather strange issue. I’ve got a Windows 7 SP1 x86 install Task Sequence that runs a hard-linked USMT state capture/state restore. The Task Sequence runs a number of VB Scripts (command lines) to do things like Rename Computer, Move OU, Set Time Zone etc. When I test the end-to-end build process on a Virtual Machine, everything works perfectly fine. When I test the end-to-end build process on a physical machine, I get errors when trying to run VB scripts but those sequenced after State Restore. In the case of a vbscript used to Rename Computers, this has to run after State Restore so I need this to work. The problem running scripts only occurs if State Restore is enabled (and runs). After State Restore has ran, no VB Scripts that require "CreateObject" can be used from the OSD Task Sequence. I’m yet to test if the problem exists without a hard-link USMT (and instead use a State Migration Point). The smsts.log error I get when attempting to run a VB Script is: CScript Error: Can't find script engine "VBScript" for script "C:\_SMSTaskSequence\Packages\CEN00003\RenameComputer.vbs". As a trial I converted one of the VB Scripts into a VB.NET console EXE and I piped out the error message(s) to see if I could trap more information, after calling CreateObject(“Wscript.Network”) or CreateObject(“Wscript.Shell”) or even CreateObject("NameTranslate") – I get a fairly generic error: Error occured: Cannot create ActiveX component. Here’s what I have tried so far: • Re-register vbscript.dll • Re-set the following Registry Key “HKLM\SOFTWARE\Microsoft\COM3\REGDBVersion” (suggestion from Google) • Rebooting after State Restore • Calling the VB Scripts with Wscript or Cscript • Checked file associations – have read something like AV could be resetting these so it can scan the scrips prior to execution, however VBS is still associated as standard • Reordered Task Sequence so Applications install last in-case it was something to do with SAV (before I discovered the problem only happens if State Restore runs) • Reverted back to the original MigUser.xml and MigApp.xml’s (in-case something within my customised USMT XML’s were nuking something) • Removed the option to “Run this step as the following account” Outside of the Task Sequence, the scripts work perfectly fine. Also, when sequenced in a dedicated test Task Sequence, the scripts work perfectly fine. I’m stumped. Any suggestions? Ben
May 22nd, 2011 7:09am

Have you tried adding a reboot after the state restore and before your scripts? Or running your scripts before the state restore?Jason | http://myitforum.com/cs2/blogs/jsandys | Twitter @JasonSandys
Free Windows Admin Tool Kit Click here and download it now
May 22nd, 2011 11:02am

Hi Jason, Thanks for your suggestion, but unfortunately i've already tried that and it's not having any affect. Thanks Ben
May 22nd, 2011 4:46pm

Tried what? You description says that if State Restore runs first, then you have issues. Based upon that, it would make sense that putting the scripts before the restore state would change the behavior. If not, then your base statement is inaccurate. Can you post your Task Sequence, your smsts.log, and your relevant scripts?Jason | http://myitforum.com/cs2/blogs/jsandys | Twitter @JasonSandys
Free Windows Admin Tool Kit Click here and download it now
May 22nd, 2011 5:25pm

Hi Jason. What I did was added a reboot after the State Restore, but before the next task item which is a Computer Rename script. I can't/don't want to rename the computer until after State Restore has completed as otherwise the Computer Association will be broken. I will need to obtain approval to post the Task Sequence XML before I post it. Stand by... Ben
May 22nd, 2011 10:53pm

Coputer Associations aren't based on names, they are based on the MAC address and/or SMSBIOS GUID. System name's are not unique identifiers in ConfigMgr and thus don't make sense to use for Computer Associations. I'm assuming that you are refreshing these systems, but why the name change? Are you moving to a new naming standard? What command-line are you using to invoke the script? Is it just one script or multiple?Jason | http://myitforum.com/cs2/blogs/jsandys | Twitter @JasonSandys
Free Windows Admin Tool Kit Click here and download it now
May 23rd, 2011 10:33am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics