in

myITforum.com

This Blog

Syndication

News

What Video Game Character Are You? I am Kung Fu Master.
I am Kung Fu Master.

I like to be in control of myself. I dislike crowds, especially crowds containing people trying to kill me. Even though I always win, I prefer to avoid fights if possible.

What Video Game Character Are You?

Blogs I read

Rob Marshall @ MyItForum.com


... my god, it's full of stars

April 2011 - Posts

  • Repurposing the MDT 2010 wizard

     

    I need a nice ConfigMgr installation HTA, a front-end doing data collection over several “pages”, configuration files built from the answers, package installations started, and a nice uniform look\feel about it.

    I could write a one-off HTA for this, but thought maybe there was an engine I could use already out there, something that takes input files to produce a wizard an engineer can navigate through. I had a look on the webby, but couldn’t decide or settle on the stuff I saw. Perhaps I missed a really great tool, but I was left thinking that I’d have to write my own.

    Lots of hard work, so I’m thinking what presents a wizard I can subvert to my needs, ahem, repurpose?

    Then I remembered the editable wizard in MDT 2010, allowing engineers to produce a custom wizard that comes up during OS deployment.

    MDT2010 indeed has a wizard, and it has some good entry points too, an established XML file structure that can be edited, and a way to invoke VBScript, as well as a pane-based interface that you can navigate backwards and forwards with. It provides a framework you can hang stuff off of to build out a custom wizard. You can also perform prerequisite checking as well as data entry and form validation, and its all driven by an engine located in MDT’s Templates\Distribution\Scripts folder called Wizard.HTA.

    Ok so I know the MDT Wizard can offer me a way to present GUI elements as a its running as a HTA application, and that it can run my VBScript code, so all I need to know now is whether its portable, can I move the wizard and its supporting files out of the MDT folders and separate it? Yes, just a small bunch of files, so it won’t take much effort to include in any kits I create.

    Now the chore of editing the XML, the actual MDT Wizard engine documentation is limited, but you do have samples as well as working XML+Script that comes with the MDT 2010 installation. You can take it all apart to get an idea of what can be done here.

    The idea of hand-crafting XML doesn’t have a warming appeal, but being able to repurpose the engine did, and if I could get the engine to read in a tailored XML file and allow me to control the GUI, perform a bit of prerequisite checking and form entry and validation, all leading to unattended file generation, then it’d meet my needs to a tee.

    Shortly after touching down on the MDT 2010 Wizard as the weapon of choice, I found Michael Niehaus has written a MDT Wizard Editor tool that makes the Wizard even more accessible:

    image

    The MDT Wizard Editor, downloadable at http://mdtwizardeditor.codeplex.com/

    The MDT Wizard Editor makes life so much simpler! Now I have a better way to view the XML and interact with it, to build out a project. Nice tool Michael.

    Along with the tool, there are four articles so far, worth pouring over all of them, he explains how the engine works, and goes further, how to make modifications to build a custom wizard. Great stuff to get a handle on the wizard engine and the editor.

    MDT 2010 Wizard Editor Part 1

    http://myitforum.com/cs2/blogs/hemsell/archive/2009/03/20/microsoft-deployment-toolkit-wizard-editor-part-1-introduction.aspx

    MDT 2010 Wizard Editor Part 2

    http://myitforum.com/cs2/blogs/hemsell/archive/2009/03/20/microsoft-deployment-toolkit-wizard-editor-part-2-global-settings-and-custom-initialization-and-validation-scripts.aspx

    MDT 2010 Wizard Editor Part 3

    http://myitforum.com/cs2/blogs/hemsell/archive/2009/03/20/microsoft-deployment-toolkit-wizard-editor-part-3-panes-can-be-a-pain-or-how-to-bring-external-data-into-your-wizard.aspx

    MDT 2010 Wizard Editor Part 4

    http://myitforum.com/cs2/blogs/hemsell/archive/2009/03/20/microsoft-deployment-toolkit-wizard-editor-part-1-what-my-face-looked-like-when-i-first-tried-to-decipher-the-html-in-the-html-tab.aspx

    After taking all that lot in, you’ll be tooled up to separate out the wizard from the MDT files, and start turning out custom wizards. And after going through the existing MDT XML files you’ll know the engine pretty well, and use it to front-end whatever task you’re performing. That’s pretty impressive considering this engine was written with OS deployment in mind.

    I created my first XML file for messing around in the editor with, by cloning the Credentials.xml file as the starting point, I strip out a lot of the code, modified a few entries and left just enough to get started:

    Here’s the code:

    <?xml version="1.0" encoding="utf-8" ?>
    <!--

    ' // ***************************************************************************
    ' //
    ' // Copyright (c) Microsoft Corporation.  All rights reserved.
    ' //
    ' // Microsoft Deployment Toolkit Solution Accelerator
    ' //
    ' // File:      YOUR FILENAME.xml
    ' //
    ' // Version:  
    ' //
    ' // Purpose:  
    ' //
    ' // ***************************************************************************

    -->
    <Wizard>
    <Global>
      <CustomStatement><![CDATA[ document.title =  "YOUR TITLE" ]]> </CustomStatement>
      <CustomStatement><![CDATA[ ButtonNext.outerHTML = "<button accesskey=O id=buttonNext language=vbscript onclick=ButtonNextClick><U>O</U>K</button>"  ]]> </CustomStatement>
      <CustomStatement><![CDATA[ window.resizeTo 525,325   ]]> </CustomStatement>
      <CustomStatement><![CDATA[ window.moveTo Window.screen.width/2 - 525/2, Window.screen.height/2 - 325/2 ]]> </CustomStatement>
    </Global>

    <Pane id="PANE NAME">
      <Body>
      <![CDATA[

    <H1>SOME TEXT</H1>

    <table>
      <tr>
       <td width="100px"><u >U</u>ser Name:</td>
       <td>
       </td>
      </tr>
      <tr>
       <td><u>P</u>assword:</td>
       <td>
       </td>
      </tr>
      <tr>
       <td><u>D</u>omain:</td>
       <td>


       </td>
      </tr>
      <tr>
       <td colspan=2>

       </td>
      </tr>
    </table>


      ]]>
      </Body>
      <ButtonNext>
       <Label><![CDATA[<button accesskey=O id=buttonNext language=vbscript onclick=ButtonNextClick><U>O</U>K</button> ]]> </Label>
      </ButtonNext>
    </Pane>

    </Wizard>

    Check out DeployWiz_Definition_ENU.xml in the MDT folders, it’s loaded with example material to get you into the engine.

    Here's a screenshot of something I created quickly after I’d figured out what goes where:

    image

    To sum up, I’ve got exactly what I want without having to write any engine code!

    Nestled within the deployment toolkit is a mature wizard system that can be repurposed for all kinds of activities. It can be lifted and placed alongside other bits and bobs, to help build up a solution.

    Thanks to Michael Niehaus for the wizard editor, and to the MDT 2010 team for MDT.

    Further reading:

    MDT 2010 Wizard Editor

    Michael Niehaus' blog

    Mikael Nystrom blog

    Chris Knackers blog

    Microsoft Deployment Toolkit 2010

  • SMS2003 - Service accounts being used

    I wrote this a fair few years ago, it's for those environments still running SMS2003 who opted to use Normal Security (Service Accounts, harking back to SMS 2.0 here!) instead of using Advanced Security (computer accounts).

    The script, all it does is pump out what Service Accounts are in use on each of the site servers in the hierarchy, but first it requires a PREINST /DUMP to be performed from the Central Site server so that the Site Control Files for all Sites in the hierarchy can be queried.

    Instructions: 

    Save the file to C:\SiteControlFiles\CheckServiceAccounts.vbs

    Use PREINST /DUMP, get the resulting files from the root of the SMS drive, put them Site Control Files (CT0's) into C:\SiteControlFiles, then run this script from that folder in a CMD prompt using CSCRIPT and not WSCRIPT:

    ' Perform a PREINST /DUMP on the SMS Central to obtain all Site Control Files

    Const ForReading = 1, ForWriting = 2, ForAppending = 8

    Dim fso, ts, fc, f, f1

    Set fso = CreateObject("Scripting.FileSystemObject")

    Set f = fso.GetFolder("C:\SiteControlFiles")

    Set fc = f.Files

    WScript.Echo "SiteCode,Site Server,Service Account"

    For Each f1 in fc

     If MID(f1.name, LEN(f1.name)-2, 3) = "ct0" Then

      DisplayString = LTRIM(RTRIM(f1.name & ","))

      Set ts = fso.OpenTextFile("C:\SiteControlFiles\" & f1.name, ForReading)

      Do While NOT ts.AtEndOfStream

       tempvar = ts.ReadLine

        If tempvar = "BEGIN_SITE_DEFINITION" Then
      
        For i = 0 to 10

         tempvar = LTRIM(RTRIM(ts.ReadLine))

         if i = 2 then SiteName = LTRIM(RTRIM(tempvar))

        Next

        DisplayString = DisplayString & SiteName & "," & tempvar

        Exit Do

       End If

      Loop

      DisplayString = Replace(DisplayString, "sitectrl_","")
      DisplayString = Replace(DisplayString, ".ct0","")
      DisplayString = Replace(DisplayString, "<","")
      DisplayString = Replace(DisplayString, ">","")

      WScript.Echo DisplayString

      ts.close

      Set ts = Nothing

     End If

    Next

    I guess this could be done more elegenty via a WMI script, I might look in to that, but considering that this is old tech I probably won't bother!

  • ConfigMgr 2012: Signs of more data heading in to the database

    Paul Thompson wrote up smashing article ... gives real insight in to how the product group are thinking, and how management\access to data is being made easier in subtle, small ways for CM12.

    Paul talks about querying SQL for Client Agent properties ... if you've tried getting your hands on these properties, you are not Kim Oppalfens who digs WMI and SCF mining, and been left with a bitter experience, then you're about to get a very pleasant surprise :-)

    Without much further ado, and without stealing any more of Pauls thunder, here is his post: http://myitforum.com/cs2/blogs/pthomsen/archive/2010/11/11/152568.aspx

    Note what Paul says at the end about WMI schedules, this is important if you need to decode them.

  • ConfigMgr 2012 - P2V Migration Toolkit

    Catching up with myself now I've recovered from the "Epic Flu" :-)

    Folks already blogged about this one, but its worth repeating just for what this slick tool is going to do for us when migrations from CM07 to CM12 begin ...

    The Configuration Manager P2V Migration Toolkit was designed to assist in situations where there are remote Configuration Manager 2007 site servers that need to be retained during the side-by-side migration process to Configuration Manager 2012.

    The Configuration Manager P2V Migration Toolkit facilitates the re-utilization of existing x64 server hardware using virtualization technologies, Windows Server 2008 R2 and Hyper-V

    CTP release key features:

    ·         Task sequence\standalone media driven. Utilizes  Configuration Manager 2007’s task sequences to provide the ability to automate the majority of the end-to-end  P2V process, including:

     

    o    Offline virtualization of physical disks.

    o    Preparing the VHDs to leverage virtual storage drivers and align to virtual disk layout.

    o    Compressing of the VHD’s to reduce size on disk.

    o    Installation of Windows 2008 R2 (including enabling the Hyper-V role).

    o    Automating the creation of a Hyper-V virtual machine.

    o    Attaching the captured VHDs as a Hyper-V virtual machine.

     

    ·         User interface to create customized task sequences and standalone media. Wizard driven user interface assists in the creation of a customized Configuration Manager 2007 task sequence and standalone media specifically targeted to the P2V conversion of the remote site server.

     

    ·         Offline physical-to-virtual conversion. Offline P2V conversion is the most reliable way to ensure data consistency between the physical hard disks and the virtual copies.

     

    ·         Capture only option. Wizard driven solution to assist in the creation of bootable media, which in turn can be used to capture selected physical disk drives into Virtual Hard Disks (VHDs)

     

     

    Note that this is a CTP, a Community Technology Preview, and is therefore open to change before it RTM's.

    Swing by Connect to pick up the kit: https://connect.microsoft.com/ConfigurationManagervnext/program6835

Copyright - www.myITforum.com, Inc. - 2010 All Rights reserved.
Powered by Community Server (Commercial Edition), by Telligent Systems