• Michael Niehaus' Windows and Office deployment ramblings

    Troubleshooting MDT 2012 Monitoring

    • 0 Comments

    I mentioned a while back that I wanted to do a blog post talking about how to troubleshoot the new MDT 2012 monitoring feature for Lite Touch deployments, but first I had to actually describe it.  If you haven’t reviewed that post, you might want to check it out first at http://blogs.technet.com/b/mniehaus/archive/2012/03/09/mdt-2012-new-feature-monitoring.aspx.

    So now let’s talk about troubleshooting.  First, let’s look at the server side.  You have to enable monitoring on a computer that has MDT 2012 installed.  When you use Deployment Workbench on that computer and check the box to enable monitoring, Workbench will first check to see if the specified monitoring host name is local:

    image

    It doesn’t really matter if you specify an IP address, a short host name, or a fully-qualified host name, as long as the clients can resolve whatever you specify.  If you specify a name that Workbench doesn’t think is local (because Workbench itself can’t resolve the name back to an IP address assigned to the current machine), it won’t try to install the monitoring component; instead, it will try to contact that server to see if monitoring is running on that computer.  If it is, great; if it isn’t, you’ll see an error message:

    image

    If you look closely at the error “tip” at the end of the “Monitoring host” line, you’ll see a message like “Unable to connect to the specified server and port”.  If you think you specified the local computer name and got that error, then Workbench couldn’t figure out that it was the local computer name (something that’s harder to do than you might think).  If you are specifying a different server and see this error, then it’s having problems communicating with that other server.

    Tip #1:  Make sure the name you specify in Workbench can be resolved to the IP address of the current machine.

    What does the checkbox do?

    You’ve checked the checkbox and can’t see that anything happened.  So what was actually done?  Two things:

    1. A new “Microsoft Deployment Toolkit Monitor Service” service was installed on the computer and started.
    2. An additional entry was added to the [Default] section of CustomSettings.ini telling the clients how to contact the server, with an entry such as:

      EventService=http://mdt-server.mdt.local:9800

    Tip #2:  Make sure the “Microsoft Deployment Toolkit Monitor Service” is installed and running.  If it’s not installed and it should be, you can uncheck the box, click apply, then check the box again and click apply to reinstall it.  If it’s installed but not running, try to start it.

    Tip #3:  Make sure the entry was added to CustomSettings.ini by looking at the Rules tab.  Because of a peculiarity with the way Workbench works, if you make any changes to the Rules tab after you’ve clicked the “Enable monitoring” checkbox but before you’ve clicked OK, it’s possible that the changes made on the Rules tab overlay the EventService entry in CustomSettings.ini, but it’s easy enough to put it back manually.

    What if the service doesn’t start?

    The service has two dependencies:

    1. .NET 3.5 SP1 needs to be installed.  That shouldn’t be an issue, because you can’t install MDT 2012 without .NET 3.5 SP1.
    2. The ports you specified need to be available for use.  (Generally that’s not an issue either, as 9800 and 9801 aren’t commonly-used TCP ports.  But it is possible to have another application use them.  Fortunately, MDT will happily use other ports.)

    So there’s no dependency on IIS or SQL Server.  The service uses .NET to host a web server as part of the service process, and it uses a SQL Compact database (basically a set of DLLs, which ship with MDT, that run in the service process) to store the monitoring information.  It’s designed to be easy to install and run.

    Tip #4:  If you try to start the service and it won’t start, that most likely means the ports you chose were already in use.  (If you want to know what’s using the ports, use a tool like TCPView, available from http://technet.microsoft.com/en-us/sysinternals/bb897437.)  Pick different ports.

    While it’s always possible that there could be some other reason the service fails, I haven’t seen any other causes.  But if you know the ports are not in use and the service still won’t start, capture a trace using DebugView (http://technet.microsoft.com/en-us/sysinternals/bb896647) to see if it provides any further clues.  If not, contact Microsoft Support for assistance.

    Verifying the Monitoring Service

    The monitoring service listens on the two ports that you specified.  The first of these ports (9800) is used by computers being deployed to send progress events.  The second (9801) is used by Workbench itself to query information about deployments being monitored.  To make sure these ports are accessible, we can manually connect to each one using Internet Explorer.

    To verify the “event port” from the monitor server itself, you can use a URL such as:

    http://localhost:9800/MDTMonitorEvent/

    If that works, you should see a response like:

    image

    That’s a proper response in this case – the web service doesn’t expect to be called in this way (an HTTP GET request instead of an HTTP POST request), so it’s telling you the proper way to call the service.

    To verify the “data port” from the monitor server itself, you can use a URL such as:

    http://localhost:9801/MDTMonitorData/

    image

    This response (which is an ODATA feed in case you are curious) confirms that the data feed is working as expected.

    But those are the easy queries – they are using “localhost”, which is almost never subject to firewall restrictions.  Next, you need to try these queries remotely, using the appropriate “remote” URLs:

    http://mdt-server:9800/MDTMonitorEvent/

    http://mdt-server:9801/MDTMonitorData/

    If those work, great.  If they don’t, then you need to make sure that whatever firewall is running on the monitoring server allows the ports you specified (e.g. 9800 and 9801) to be accessed from remote hosts.

    Tip #5:  Make sure you can access the monitor service ports both locally and remotely.  Adjust the firewall rules as necessary.

    Note that there are other networking “challenges” that can get in the way, e.g. IPSec domain isolation.  In this configuration, computers that aren’t domain-joined, e.g. running from Windows PE, can’t talk to domain-joined computers because they aren’t using encrypted IPsec communication.  This type of configuration will never work – you would need to set up the monitoring service on a “boundary server” that has been configured to allow non-IPsec traffic on the configured ports.  So don’t assume that if a “remote” URL works from a domain-joined machine, it will also work from a workgroup machine (or Windows PE) – know how your network is configured.

    From the Client Side

    When the EventService task sequence variable is set (via the processing of CustomSettings.ini), each MDT script executed in the task sequence will send an event to the monitor service on the “event port” URL.  When this succeeds, you’ll see a message like this:

    image

    If a script is unable to send an event, you’ll see something different:

    image

    That’s a clear sign that something isn’t right.  Make sure the service is running, that the firewall ports are open, etc. – the same challenges we already reviewed.

    Tip #6:  Check the client logs to make sure the clients are able to talk to the monitoring service.

    Another way you might notice an issue:  If the monitor service isn’t running, the clients will still try to connect to it, eventually timing out.  This timeout process will cause a delay at the end of each step in the task sequence, so if you are watching the task sequence progress dialog, you’ll see steps that you never noticed before (because they usually run so fast) now taking a long time.

    From Workbench

    When you try to look at the monitoring data from Workbench, it calls a PowerShell cmdlet (Get-MDTMonitorData), then that PowerShell cmdlet makes the “data port” query to retrieve the details from the monitoring service.  If the service is working as expected, you can see the list of monitored machines in Workbench.  If the service isn’t working, you’ll see something like this instead:

    image

    Good advice, make sure the service is running Smile

    Finally

    Still having issues?  Post them as comments here, or send me an e-mail at mniehaus@microsoft.com and we’ll try to figure out what’s going on. 

  • Michael Niehaus' Windows and Office deployment ramblings

    Trying to install ConfigMgr 2012 RTM? Make sure you have the right SQL…

    • 2 Comments

    Now that Configuration Manager 2012 RTM is available, people will certainly start installing it, both in their labs and in production – and will start finding out that the SQL version check in the ConfigMgr installer is looking for some very specific SQL maintenance levels.  (I’ve pulled out plenty of my own hair doing this recently, just like I did with the prerelease versions.)  The supported versions can be found at http://technet.microsoft.com/library/gg682077.aspx#BKMK_SupConfigSQLDBconfig.  The summary (always subject to change):

    • SQL Server 2008 SP2 Standard and Enterprise CU9
    • SQL Server 2008 SP3 Standard and Enterprise CU4
    • SQL Server 2008 R2 SP1 and CU6
    • SQL Server Express 2008 R2 and CU4 (secondary sites only)

    If you are running SQL 2008 SP2, install CU9 from http://support.microsoft.com/kb/2673382/.  If you are running SQL 2008 SP3, install CU4 from http://support.microsoft.com/kb/2673383/.  If you are running SQL Server 2008 R2 SP1, use CU6 from http://support.microsoft.com/kb/2679367/.  If you aren’t yet on the needed service pack levels, upgrade now, then install the cumulative updates :-)

    I’m still looking for a statement on ConfigMgr 2012 RTM and SQL Server 2012.  (ConfigMgr 2007 now supports it, see http://blogs.technet.com/b/configmgrteam/archive/2012/04/17/configuration-manager-support-announcements-for-april-2012.aspx.)  There’s already a CU1 for SQL Server 2012, http://support.microsoft.com/kb/2679368/.

  • Michael Niehaus' Windows and Office deployment ramblings

    Inside a Task Sequence

    • 0 Comments

    I’ve done a few sessions now where I demonstrated how to put some hooks into a task sequence so that you can single step through the process and “poke around” to see exactly what is going on.  Since I’ve promised to make those scripts available, and will get lots of e-mails from people if I don’t do that, I’ll provide those at the bottom of this blog posting.

    But the scripts by themselves require some explanation, some instructions, and some caveats. 

    Some Explanation

    First, let’s talk about the basic setup.  If you look at a ConfigMgr task sequence, it contains a number of steps and groups that define the sequential process that is going to be executed.  This is actually converted into XML, where each step and group becomes a series of XML entries that define:

    • The command line to be executed.
    • The variables that are expected by the step (at least those that can be configured by the task sequence editor – the step’s command may use others).
    • The conditions for the step – if the conditions aren’t satisfied, the step won’t run.
    • The definition of success – a list of return codes that should be considered “successful”, typically 0 and 3010.  You can also say to ignore errors, which means to ignore the return code.

    Before the client computer begins to execute the task sequence, it receives (as part of the task sequence policy) the entire XML blob.  That XML blob is then processed by the Task Sequence Manager, TSManager.exe, which is what actually starts the commands for each step (at least those where it has decided the conditions have been met).

    So that’s a key part of what we want to do:  We want to intercept each of the commands that are being executed by the TSManager.exe process before they actually start. That way, we can look at the task sequence variables currently defined, the command line details, the step’s XML, etc.  How do you do this intercepting?  That’s where a debugger comes in.  A debugger can attach the TSManager.exe process, then set a breakpoint on the Windows API call, CreateProcessW, that is used by TSManager to run the command for each step.  Each time TSManager.exe then tries to run a new command, the debugger will stop the process until you manually say continue.

    That’s where the scripts come in:  The provided “InsideTS” scripts take care of setting up the debugger (attaching to the TSManager.exe process, setting the breakpoint), watching for breakpoints (checking the log for “breakpoint hit” messages), and showing the current state (displaying the step details, task sequence variables, logs, etc.).  The pieces involved:

    • InsideTS_Attach.wsf.  This is the script hooked into the task sequence itself.  It needs to run at the beginning of the task sequence and then each time the computer reboots.  (The debugging process doesn’t survive reboots.)  It launches the next script, InsideTS_Monitor.wsf, to do the real work, waits until the debugger process (NTSD.EXE) shows up, then exits.
    • InsideTS_Monitor.wsf.  This script, as already mentioned, starts the debugger, NTSD.EXE.  It feeds it initial commands to attach to TSManager.exe, to set the breakpoint on CreateProcessW, and to write all the debugger output to a file.  The script then monitors the log file looking for “breakpoint hit” messages, and when that happens, it starts a wizard, InsideTS_Details, to show the details of what’s currently going on.
    • InsideTS_DebugCommands.txt.  This file contains the initial commands that are passed to NTSD.EXE.
    • InsideTS_Details.xml, InsideTS_Details.vbs, and InsideTS_Header.jpg.  These files form an MDT HTA wizard pane (which is why this setup requires scripts from MDT, which will be described below).  This wizard pane will show three tabs:
      • Task Sequence.  This will give a graphical representation of the task sequence, like you would see in the task sequence editor, and will highlight the step that is about to run.  (The breakpoint happens right before this step starts.)
      • Variables. This will show a list of all the task sequence variables.  New variables (those that haven’t been seen before) will show up in green.  Existing variables that have new values will show up in yellow.  Those that no longer exist (e.g. local variables that are valid only for a single task sequence step) will show up in red (showing the old value that is no longer present).  And finally, those that are unchanged since the last step will not be highlighted (showing up in white).
      • Step.  This will show the definition of the step in two ways.  First, it will show the XML definition for the step from the task sequence XML blob (which itself is stored in a task sequence variable).  It will also show the MOF definition of the step (basically, the definition that the task sequence editor uses to configure the step via the GUI).
    • InsideTS_TaskSequence.xsl.  This is an XML style sheet that converts the task sequence XML blob into displayable HTML.  The resulting HTML is displayed on the Task Sequence tab, described above, with the current step highlighted.
    • InsideTS_Variables.xml.  This is another XML style sheet, used to convert the list of task sequence variables (which are saved into an XML file by the InsideTS_Monitor.wsf script – they aren’t typically stored in this way) into HTML displayed on the Variables tab of the details wizard described above.
    • InsideTS_MOF.xml.  This file contains the definitions for each of the steps used in ConfigMgr 2012 and MDT 2012 task sequences.

    Some Instructions

    In addition to the files listed above, you need to gather these additional files:

    • From the Windows Debugger tools download (http://msdn.microsoft.com/en-us/windows/hardware/hh852363), you need one file, NTSD.EXE.
    • From ConfigMgr 2012, you need a copy of the CMTrace.exe.
    • From MDT 2012, you need several files to support the scripts and wizards described above:
      • Computer.png, FolderIcon.png, ItemIcon1.png, MinusIcon1.png, NavBar.png, PlusIcon1.png, Wizard,ico (graphics used in the wizard pane).
      • Wizard.hta, WizUtility.vbs, Wizard.css (the MDT HTA wizard “engine”).
      • ZTIDataAccess.vbs, ZTIUtility.vbs (main MDT utility scripts).
      • ServiceUI.exe (a component from MDT that enables the MDT HTA wizard to be visible from the ConfigMgr task sequence, even when in the full OS).

    Once you have gathered all of these files into one folder, they need to be added into the ConfigMgr boot image that you will be using and into the new OS image that you are deploying.  Create an “InsideTS” folder at the root of both of these.  (The simplest way to do this: mount both of the WIMs, XCOPY the folder to X:\InsideTS, commit the changes, then update the DPs.)  Why do I include these files in the images?  Well, it was easier to do it that way.  (More on that later.)

    Now that the files have been added to the boot and OS images, you then need to add commands to the task sequence to run InsideTS_Attach.wsf.  How many steps you need to insert into this depends on how many reboots you expect the task sequence to perform; you need one after each reboot.  At minimum, you will need two, one to run in Windows PE for preinstallation steps and a second to run in the new OS.  The step should look like this:

    image

    Assuming you have set everything up right, you should be able to start the task sequence and see something like this show up:

    image

    This shows the step after the “InsideTS Attach” as being the next one to execute.  You can then click on the “Variables” button and see that all of the variables are highlighted in green because they are all considered “new” (as in “never seen before”) at this point:

    image

    Once you’ve poked around enough, click the “Finish” button to close the wizard.  At that point, you’ll see a strange sight: the NTSD debugger.  In a perfect world, the InsideTS_Monitor.wsf script would feed the commands to continue with the step execution once you’ve clicked “Finish” on the wizard, but after messing around with that for a couple of hours, I gave up on that and went with a lower-tech approach:  Type in the needed commands yourself.  In case you aren’t familiar with NTSD command line options, here’s a quick reference to the ones you’ll need to know:

    • “G” means go.  Type G to run the step.
    • “Q” means quit.  You’ll have to type Q to exit the debugger after the TSManager.exe process exits (which it does before rebooting and before the task sequence completes).  If you type Q before that point, the task sequence will die (it quits the debugger and the TSManager.exe process being debugged), so don’t do that.  (If you do want to continue the task sequence without any more breakpoints, type “bc0” to clear the breakpoint, then “g” to continue the execution.)

    That’s really all you need to know.  (I used one other command, “du rdx”, to dump out the CreateProcessW command line parameter during the session, but you can see the same value at the end of the SMSTS.LOG, which you can open by clicking the “Log” button in the wizard.)

    Some Caveats

    Some people know the story behind this little tool:  I originally put these scripts together for a BDNA “SCCM Guru” webcast back in November.  The webcast was scheduled months in advance, so I assumed I had plenty of time to prepare.  For a variety of reasons (including procrastination) I didn’t prepare for this nearly as soon as I had hoped.  In fact, I didn’t start most of it until about 30 hours before the presentation was due to start.  And for about 18 of those hours, I was travelling back to Seattle from Moscow – in coach of course.  So all the preparation work was done on the airplane, with the scripting done on the Moscow to New York flight, when there was no internet connection, and the testing (and bug fixing) happening on the flight from New York to Seattle (VPN connection from the airplane to my office Hyper-V server, thank you http://www.gogoair.com).  The next morning, I presented the session, completely jetlagged…

    So there’s my excuse for the following caveats:

    • I suspect you could add the files to the MDT toolkit files package, then put the “InsideTS Attach” step after each “Use Toolkit Package” step.  That would avoid needing the files in the boot image image and OS WIMs.  That may require script changes.
    • I think this will work for both x86 and x64, but I’ve only tried it with x64.  (Make sure you get the right platform version of NTSD.EXE and ServiceUI.EXE.)  If you want it to work for both (e.g. x86 boot image deploying an x64 OS), you will likely need to make changes to the scripts.
    • You should be able to use this for refresh executions as well, but you’ll then need at least three “InsideTS Attach” steps (one for the original OS, one in Windows PE, one in the new OS).
    • I’ve only tried this with ConfigMgr 2012, but it should work with ConfigMgr 2007 too (although since the task sequencer runs as x86 even on an x64 OS, there might be some script updates needed to run the appropriate tools on each platform).
    • This same process should work for Lite Touch task sequences too, but I’ve not tried that yet.
    • I cheated on the task sequence step MOF class definitions.  While the “source” files for these are in the ConfigMgr (_TaskSequenceProvider.mof) and MDT 2012 (Microsoft.BDD.CM12Actions.mof) installation directories, these files are not easy to read from a script.  So I merged these files together, then put XML “wrapper” around each step to make it easier to display the MOF details.
    • I tried a variety of debuggers (there are several included in the debugging tools download) to try to get one that I could drive via a script, but I had issues with them that prevented complete automation.  That’s why you have to manually type “g” and “q” to interact with the debugger directly.  I suspect this is fixable, but I haven’t had a chance to try it.
    • Don’t use this with live, production task sequences.  Think of it more as a “learning” tool that you can use in your lab to figure out what happens during a task sequence.
    • Don’t call Microsoft for support.  You can e-mail me with comments and suggestions if you would like.  The standard Microsoft disclaimer:

    This script code is provided as is with no guarantee or warranty concerning the usability or impact on systems and may be used, distributed, and modified in any way provided the parties agree and acknowledge the Microsoft or Microsoft Partners have neither accountability or responsibility for results produced by use of this script. Microsoft will not provide any support through any means.

    Finally

    If you manage to set this up successfully, or if you run into any issues, please e-mail me at mniehaus@microsoft.com to let me know.  I think the instructions and scripts should work, but I offer no guarantees Smile

  • Michael Niehaus' Windows and Office deployment ramblings

    Have you tried the Application Approval Workflow solution accelerator?

    • 1 Comments

    System Center 2012 Configure Manager includes an application catalog web site, which allows end users to select the applications that they want to install.  As part of this, they provide the ability to specify that approval is required before the software can be installed, a required feature in most enterprises.  If you aren’t familiar with the application catalog, the blog posting at http://blogs.technet.com/b/ptsblog/archive/2011/12/20/configuration-manager-2012-rc-configure-software-catalogue-portal-and-publish-applications.aspx goes through the flow (although it’s slightly out of date, it gets the point across).

    But out of the box, approvals come from exactly one source:  the ConfigMgr administrator.  What if you want others to do the approvals (mainly because you have better things to do)?  That’s where the newest free solution accelerator comes in.  The Application Approval Workflow solution accelerator was announced on the Service Manager blog at the beginning of this week:

    http://blogs.technet.com/b/servicemanager/archive/2012/03/26/application-approval-workflow-aaw-solution-accelerator-beta-now-available.aspx

    The solution works by leveraging three different System Center 2012 products:

    • Configuration Manager, for showing the application catalog and accepting user requests.
    • Service Manager, which handles the approval requests using the “service request” functionality.  Approvers can be defined for each application, groups of applications, groups of users, etc.
    • Orchestrator, which is responsible for doing the behind-the-scenes work coordinating the activities between Configuration Manager and Service Manager.

    The beta ends soon, so download quickly.  Expect to see more about this at MMS 2012 too.

  • Michael Niehaus' Windows and Office deployment ramblings

    MDT 2012 New Feature: Monitoring

    • 10 Comments

    I was going to do a blog posting talking about how to troubleshoot issues with the new monitoring feature available in MDT 2012 for Lite Touch deployments, but then I realized I’ve not yet done an initial post talking about the feature (although I did mention it in a previous blog posting talking about DaRT integration).  So I guess I need to start with more of an overview.

    Over the years, there have been requests for a way to see what deployments are presently in progress.  Way back when, we had a MOM management pack that tried to do this, but there were numerous challenges with that so we ended up removing it – we needed something much simpler.  So with MDT 2012, we implemented something simpler to monitor Lite Touch deployments.  To enable this, just check one box in the deployment share properties:

    image

    When you do this, two things happen:

    1. A new service, the “Microsoft Deployment Toolkit Monitor Service” (short name MDT_Monitor), is installed on the computer.  This service receives events from the computers being monitored, tracking each computer and how far it is in the deployment process.  It also provides this tracking data to Deployment Workbench for you, the administrator, to see.
    2. The CustomSettings.ini file is modified to add a new entry specifying the URL (a combination of the host name and port specified in the deployment share settings) to be used for monitoring.  This is how clients know where to send information.  The MDT scripts (through their use of ZTIUtility.vbs) will automatically send events to this URL.

    That’s all there is to it.  Once you do that, you should be able to track all subsequent deployments via the “Monitoring” node in Deployment Workbench:

    image

    If you look at the properties of any of the computers being monitored, you can see the details:

    image

    You’ll notice that the display automatically updates every 10 seconds, so you can watch the computer progress.  Also, there are three possible buttons (two of which are shown below):

    • Remote Desktop.  This button runs the Remote Desktop Client (MSTSC.EXE), specifying the host name to connect to on the command line.  (This will only work if the computer is presently in a full OS and remote desktop is enabled and accessible through the firewall.  It won’t work if the computer is in Windows PE.)
    • VM Connection.  This button will only show up if you are using a Hyper-V VM.  If you click it, it will run the Hyper-V connection tool (VMConnect.exe) to connect to the host and VM name of the machine.  (We gather that information from the Hyper-V integration components from ZTIGather.wsf and pass those values along to the monitor service.  Because the integration components don’t run in Windows PE, we can only get this information when in a full OS, so this button will not be enabled when starting a new computer deployment from Windows PE.  Also, this requires that the Hyper-V host be accessible from the computer running Deployment Workbench.)
    • DaRT Remote Control.  This button will only show up if DaRT has been integrated into the MDT Lite Touch boot image.  It will run the DaRT Remote Control Viewer, passing along the computer’s IP address, DaRT ticket number, and listening port number, using those values to automatically initiate a remote control session.  (This will only work when the computer is in Windows PE, because the DaRT remote control agent only runs in Windows PE.)  See http://blogs.technet.com/b/mniehaus/archive/2011/11/28/mdt-2012-new-feature-dart-integration.aspx for more information about the DaRT integration.

    A few other details:

    • The computers will be automatically removed after three days, to keep the database from getting too big.
    • If the monitoring service doesn’t hear from a computer for more than four hours, it considers the machine “unresponsive” – so if you see that status in the Workbench list, that’s why.
    • Every time a deployment task sequence starts, completes, or fails, an event log message will be written by the service.  So if you want to trigger some activity based on these events, you can easily do so.
    • You might think that IIS would be required for the MDT_Monitor service, but it’s not.  It’s leveraging features of the .NET Framework to run a “mini web server” as part of the service itself.
    • You might also think that a SQL database would be required to store the details.  Well, there is one, but you don’t need to install SQL Server to use it.  MDT uses a SQL Compact database; all the files needed are installed as part of MDT (and only used if monitoring is enabled).

    That’s the quick overview.

  • Michael Niehaus' Windows and Office deployment ramblings

    MDT 2012 New Feature: Item Sorting

    • 4 Comments

    For those of you who have already installed MDT 2012 RC1, you might notice that there is a new behavior in Deployment Workbench:  It will keep the list of items (applications, drivers, OS packages, task sequences) in alphabetical order.

    Now when you first install MDT 2012 RC1, you might notice that the items aren’t sorted right away – you have to change something in the folder first.  As soon as you do (e.g. add an item, rename an item), the items in that folder will be sorted.

    Keeping the list of folders sorted is a much bigger challenge, so at this point they will still show up in the order that they were added. That’s something we will have to look at again in a future version.

  • Michael Niehaus' Windows and Office deployment ramblings

    Trying to install ConfigMgr 2012 RC2? Make sure you have the right SQL…

    • 5 Comments

    Now that Configuration Manager 2012 RC2 is available, people will certainly start updating their labs – and finding out that the SQL version check in the ConfigMgr installer is looking for some very specific SQL maintenance levels.  (I’ve pulled out plenty of my own hair doing this recently.)  The release notes cover the supported versions:

    Supported versions of SQL Server 2008 for RC2:

    • SQL Server 2008 SP2 Standard and Enterprise CU7
    • SQL Server 2008 R2 SP1 and CU4
    • SQL Server Express 2008 R2 and CU4

    If you are running SQL 2008 SP2, install CU7 from http://support.microsoft.com/kb/2617148. If you are running SQL Server 2008 R2 SP1, use CU4 from http://support.microsoft.com/kb/2633146.  If you aren’t yet on the needed service pack levels, upgrade now, then install the cumulative updates :-)

  • Michael Niehaus' Windows and Office deployment ramblings

    Customizing Wizards with MDT 2012

    • 5 Comments

    Many of you have customized the MDT 2010 wizards, and I expect that will be fairly common with MDT 2012 as well – after all, one of the design goals with having HTA-based wizards is to enable customization by creative IT pros.  But the process is going to be slightly different with MDT 2012.

    First, let’s review the basic process most of you would go through with MDT 2010:

    • Download the MDT Wizard Editor from http://mdtwizardeditor.codeplex.com/.  This makes editing the wizard simpler (although not necessarily trivial – there can still be a fair amount of work to do, depending on the extent of the changes that you intend to make).
    • Open the “DeployWiz_Definition_ENU.xml” file and make the necessary changes:  Adding new panes, changing the HTML and properties of existing pane, etc.
    • Using Notepad or any other text editor, add any custom scripting to DeployWiz_Initialization.vbs or DeployWiz_Validation.vbs.
    • Test out all the changes using the MDT Wizard Editor, or if this isn’t possible (due to conditions on the wizard pane or logic contained in the pane itself) drop the changed files into the deployment share and try a deployment.

    So it’s quite reasonable for you to try the same thing with MDT 2012.  But you’ll quickly discover that you can’t get very far.  You can open the file, but as soon as you click on one of the wizard panes in the left-hand column, you get this exception:

    image

    So what causes this?  Well, if you look at the files in the deployment share, you’ll notice that there are quite a few more that start with “DeployWiz”.  That’s because the entire wizard has been restructured.  Instead of having one set of large files (DeployWiz_Definition_ENU.xml, DeployWiz_Initialization.vbs, DeployWiz_Validation.vbs), there are now separate files for each wizard pane (e.g. DeployWiz_ComputerName.xml and DeployWiz_ComputerName.vbs).  The original files (DeployWiz_Definition_ENU.xml, etc.) are still around, but are much smaller – the bulk of the content has been separated out.

    Why was this done?  Mainly because it makes the wizard code much easier to maintain.  It’s now much more obvious what script pieces are used for which wizard panes.  Additionally, it makes the wizard easier to test, as you can work on a single pane at a time without worrying about breaking another unrelated pane.

    The individual panes are then tied together by the DeployWiz_Definiton_ENU.xml file.  If you look at this file, you’ll see that it’s pretty short, with entries like this:

    <Pane id="SelectTaskSequence" reference="DeployWiz_SelectTS.xml">
        <Condition><![CDATA[UCASE(Property("SkipTaskSequence"))<>"YES" ]]></Condition>
    </Pane>

    All that is there is a reference (or link) to the separate files for each wizard pane, along with the conditions for when each wizard pane should be displayed.  (This helps with the testing as well:  By keeping the conditions in the DeployWiz_Definition_ENU.xml file instead of in the individual wizard files, those conditions don’t get in the way of “offline testing”, e.g. running just that one single wizard pane without going through a full deployment.)

    So why does that cause problems with the Wizard Editor?  Simple:  It doesn’t understand that the wizard pane body is in a separate file.  It can’t follow the reference link (highlighted in yellow above) to the separate wizard pieces.  So does that mean the Wizard Editor is no longer useful?  Not at all – you can still use it to work on (and test) individual pages like DeployWiz_ComputerName.xml:

    image

    But you’ll need to edit the DeployWiz_Definition_ENU.xml file by hand.

    I’m working on a new version of the Wizard Editor in my “free time” so that it learns how to follow these links (with other improvements added in too), but it might take a while before I can complete that work.

    So what does the recommended workflow look like if you wanted to add a new wizard pane to MDT 2012?  Here are the basics:

    • Download the MDT Wizard Editor from http://mdtwizardeditor.codeplex.com/.
    • Make a copy of files for one of the wizard pane files.  For example, copy DeployWiz_AdminPassword.xml as “MyPane.xml” and DeployWiz_AdminPassword.vbs as “MyPane.vbs”.
    • Use the Wizard Editor to customize and test the new wizard pane.
    • When you are happy with the functionality of the new wizard pane, add an entry for it into DeployWiz_Definition_ENU.xml (just like all the others, with any conditions that you might need), then test it out as part of a normal deployment.

    This new flow has another advantage too:  It makes it much easier to integrate a new wizard pane into MDT.  You don’t have to worry about reintegrating your changes into the “big” XML file each time you upgrade MDT – your separate files will continue to exist, untouched, so all you will need to do is add the “link” into DeployWiz_Definition_ENU.xml again and you’re good to go.

  • Michael Niehaus' Windows and Office deployment ramblings

    Creating the ConfigMgr “System Management” Container with PowerShell

    • 4 Comments

    One of the steps in the Configuration Manager installation process is to manually create the “System Management” container in Active Directory, then give the ConfigMgr computer account the ability to create objects in it.  Yes, even with Configuration Manager 2012, this is still something that needs to be done manually.

    So that was this evening’s challenge:  Automating that seemingly simple task.  As with all automation tasks, you always hope that someone has already solved the problem.  But even with searching multiple search engines (something that always pains me), I didn’t really find what I was looking for.  (No executables, no third-party tools, no ugly ADSI code, and ideally no VBScript – PowerShell is the future.)  So I created a new PowerShell script, incorporating bits and pieces from several other scripts.  The basic steps:

    • Import the “ActiveDirectory” PowerShell module (which only exists in Windows Server 2008 R2, so that is required).
    • Figure out our domain name (so we don’t have to hard-code a value in the script).
    • Create the “System Management” container if it doesn’t already exist.
    • Get the computer account (from the environment, so we don’t need to hard-code that either).
    • Add the computer account to the “System Management” container’s access control list, giving it full access.

    Sounds simple enough, and except for the ACL part, it is.  The complete script:

    #Requires -version 2.0

    # ***************************************************************************
    #
    # File:      SystemManagement.ps1
    #
    # Version:   1.0
    #
    # Author:    Michael Niehaus
    #
    # Purpose:   Create the AD "System Management" container needed for
    #            ConfigMgr 2007 and 2012, and grant access to the current
    #            computer account.
    #
    #            This requires PowerShell 2.0 and Windows Server 2008 R2.
    #
    # Usage:     Run this script as a domain administrator, from the ConfigMgr
    #            server.  No parameters are required.
    #
    # ------------- DISCLAIMER -------------------------------------------------
    # This script code is provided as is with no guarantee or waranty concerning
    # the usability or impact on systems and may be used, distributed, and
    # modified in any way provided the parties agree and acknowledge the
    # Microsoft or Microsoft Partners have neither accountabilty or
    # responsibility for results produced by use of this script.
    #
    # Microsoft will not provide any support through any means.
    # ------------- DISCLAIMER -------------------------------------------------
    #
    # ***************************************************************************

    # Load the AD module

    Import-Module ActiveDirectory


    # Figure out our domain

    $root = (Get-ADRootDSE).defaultNamingContext


    # Get or create the System Management container

    $ou = $null
    try
    {
        $ou = Get-ADObject "CN=System Management,CN=System,$root"
    }
    catch
    {
        Write-Verbose "System Management container does not currently exist."
    }

    if ($ou -eq $null)
    {
        $ou = New-ADObject -Type Container -name "System Management" -Path "CN=System,$root" -Passthru
    }


    # Get the current ACL for the OU

    $acl = get-acl "ad:CN=System Management,CN=System,$root"


    # Get the computer's SID

    $computer = get-adcomputer $env:ComputerName
    $sid = [System.Security.Principal.SecurityIdentifier] $computer.SID


    # Create a new access control entry to allow access to the OU

    $ace = new-object System.DirectoryServices.ActiveDirectoryAccessRule $sid, "GenericAll", "Allow", "All"


    # Add the ACE to the ACL, then set the ACL to save the changes

    $acl.AddAccessRule($ace)
    Set-acl -aclobject $acl "ad:CN=System Management,CN=System,$root"

    The same script is attached.

  • Michael Niehaus' Windows and Office deployment ramblings

    MDT 2012 New Feature: Gather improvements

    • 4 Comments

    Sometimes it’s the little things that most people fail to notice that need some attention.  In this case, we’re talking about new task sequence variables automatically set by the MDT “Gather” process (specifically, the ZTIGather.wsf script).  There are a few new ones in MDT 2012:

    • IsOnBattery.  This will be set to true if the machine is currently running using a battery with no AC power.  This can be useful in any deployment – you really don’t want a computer to turn off because the battery went dead during a deployment.
    • VMHost.  When a virtual machine is running on a Hyper-V server and has the Hyper-V integration components installed, we can determine the name of the Hyper-V server (the VM host) that the VM is running on.
    • VMName.  This also comes from the Hyper-V integration components, telling us the name of the virtual machine in Hyper-V, which might be different than the “computer name” (the name given to the OS) of the VM.

    We also made a few other related changes:

    • The “Make” property now detects Xen, in addition to the the other platforms that could be detected in MDT 2010 Update 1 (Hyper-V, VMWare, VirtualBox).
    • We fixed the “SMSDP” property, so it should now always return a valid server name for the ConfigMgr distribution point that the boot image associated with the task sequence came from.  (The task sequence doesn’t have a distribution point, so we had to pick a package that each task sequence should have.)
    • We changed the “OSVersion” property so that it doesn’t generate an error on unknown OSes (e.g. Windows 8).  We don’t plan to add new OSes to the list set by this function, so consider this variable to be “functionally stabilized” and “obsolete”.  It would be better to use OSCurrentVersion or OSCurrentBuild (maybe combined with IsServerOS) instead.
    • We added progress reporting (which works with Lite Touch and ConfigMgr deployments) so that you can see what ZTIGather is doing during the process.  This will be especially useful when you are doing database queries: you’ll be able to see which ones are taking too long.
Page 1 of 24 (236 items) 12345»