locked
HTA error - ActiveX component can't create object: 'Microsoft.SMS.TSEnvironment' RRS feed

  • Question

  • Hi All,

    I'm in the process of setting up our OSD environment with our new CM12 setup. Its a lite tough process using MDT 2012 and has a requirement for joining machines to different domains/OUs depending on the name provided by the technician in the MDT lite touch GUI.

    I've already realised I cant use a WMI query in the TS as the domain join happens in WinPE so the name is still a MININT- name.

    Looking at my options I've decided to add some code to the wizard.hta to set a new custom TS variable that I can use later in the sequence. I was originally just going to create a file in x: that I could look for but as we have 32bit and 64bit TS using installers not images the process needs to reboot into the other boot.wim to continue and the file is lost. I discovered TS variables are saved across reboots so its my only options really.

    I thought this would be simple as there is a bunch of documentation for this so I edited wizard.hta and added some processing to create the variable when the Finish button was clicked. See below:

    Sub ButtonNextClick
    
    dim TSEnv
    
    	If buttonNext.Disabled then
    		Exit sub
    	End If
    '###start of code add	
    	Set TSEnv = CreateObject("Microsoft.SMS.TSEnvironment")
    	TSEnv("foo") = "value"
    	
    '###end of code add
    
    	SetPane "", True
    End Sub

    This is where is when wrong, when the Finish button is clicked the hta produces an error stating that ActiveX component can't create object: 'Microsoft.SMS.TSEnvironment' I've been messing with this for two days now and just cant get it to work. Can someone sugest what may be wrong as its killing me!
    Friday, June 14, 2013 12:43 PM

Answers

All replies

  • you can ignore that error if you are simply testing your HTA code in windows without running it directly from a task sequence, try running it in a live task sequence in WinPE and you won't see that error any more (it means it can't find the live task sequence environment)


    Step by Step Configuration Manager Guides > 2012 Guides | 2007 Guides | I'm on Twitter > ncbrady

    Friday, June 14, 2013 1:12 PM
  • That's what I thought at first but I've run this from a pxe booted TS and the MDT wizard pops up fine, when I click finish I get the error. Is it possible the at the MDT prompt from ztimediahook runs before the TS environment is initialised?
    Friday, June 14, 2013 1:29 PM
  • TS Environment is not available until you select a TS and the task sequence is running. If your just at the menu to select a TS it won't be available until you select a TS and the TS starts. Where you trying to run it at the menu if so that's why.

    Justin Chalfant | My Blog | LinkedIn | Please mark as helpful/answer if this resolved your post

    • Marked as answer by Tech_SR Sunday, June 16, 2013 10:13 AM
    Friday, June 14, 2013 4:43 PM
  • @Justin - thanks for the info, I feared as much. I ran a script and I can see TS variables populated at the point MDT is asking for the computername (before the password prompt for the TS) and this must store it somewhere as the PC is named correctly once the boot image changes. Is this held somewhere outside of TS variables that I can write to?

    Other than that does anyone have any experience of implementing the UDI frontend for MDT with SCCM?

    Friday, June 14, 2013 7:37 PM
  • Here's a video that should help you get started creating a basic UDI task sequence with MDT: http://www.youtube.com/watch?v=wi1I2XfO11M. I'm not sure about your first question.

    Justin Chalfant | My Blog | LinkedIn | Please mark as helpful/answer if this resolved your post

    • Edited by Justin Chalfant Friday, June 14, 2013 8:04 PM
    • Marked as answer by Tech_SR Sunday, June 16, 2013 10:13 AM
    Friday, June 14, 2013 8:04 PM
  • try the below it hasn't changed too much since I posted these



    Step by Step Configuration Manager Guides > 2012 Guides | 2007 Guides | I'm on Twitter > ncbrady

    • Marked as answer by Tech_SR Sunday, June 16, 2013 10:13 AM
    Sunday, June 16, 2013 10:11 AM
  • @Niall, thanks for these. I've supressed the MDT media hook and started implementing UDI, seems to be simple enough (I think)!

    Sunday, June 16, 2013 10:13 AM