Michael Niehaus' Windows and Office deployment ramblings
In BDD 2007, we provide a task sequence that is preconfigured to do all of the activities needed to perform a deployment end-to-end (for Lite Touch, Zero Touch, refresh, upgrade, new computer, Windows XP, Windows Vista, etc.). However, that doesn't mean that it does everything you need. Depending on your particular requirements, you may need to add your own custom steps to the task sequence. That's one of the benefits of having the task sequencer and task sequence editor available: you can make whatever adjustments you require.
Now, that doesn't mean that making those adjustments is always a simple process. For example, let's assume you want to add batch files or simple Command Shell commands into the task sequence. Some things to keep in mind to help assure that these run successfully:
What if you want to test out a new task sequence action without running an entire deployment to do it? Well, you can create your own stand-alone task sequencer XML file, then tell it to run that. (Note that the typical environment variables, e.g. DEPLOYROOT or SCRIPTROOT, won't be defined in this case.) Here's the process that you need for that:
Any other suggestions? If so, please submit comments below and I'll continue to integrate them into this posting.
First, some background information.
We use the User State Migration Tool 3.0 as part of the user state migration process in BDD 2007 (both Lite Touch and Zero Touch deployments). Unlike previous versions of BDD, we don't run USMT from the network. Instead, we install USMT 3.0 locally on the computer, first in the old operating system for capturing user state, and later in the new operating system for restoring it. Why install it locally? Well, there are four main reasons:
But there was one complication and one glitch in the process. First, the complication: There are four different installers:
So in most cases, you'll need at least two of these for any migration. That's simple enough, since the ZTIUserState.wsf script figures out which one is needed and knows how to install each one. Then there's the glitch: Due to a bug in the Vista installation program, WUSA.EXE (used to install MSU files), USMT 3.0 would not install quietly using the standard "/quiet" switch. This resulted in a workaround implemented in the ZTIUserState.wsf script and described in the BDD 2007 release notes (which hopefully you've read):
Fortunately, since the release of USMT 3.0 there has been a hotfix made available for Windows Vista to fix this "/quiet" installation problem, so if you include this fix in your Windows Vista image you won't need to worry about the workaround above. See http://support.microsoft.com/kb/929761/en-us for more information on that.
Now, let's talk some about customization.
You might not want to use the default USMT 3.0 settings for your deployment. You may choose to create your own XML files, or to customize the provided XML files. Some examples of the types of changes you might want to make:
One customization you probably don't want to make: removing stuff from the default XML files. It's better to use a CONFIG.XML file to do that instead, but more on that later. Going into the specifics of how to make the XML customizations like those I've listed above could be the subject of a book in itself (any takers?), so let's focus instead on the process of making use of the files that you've created or customized. First, test your changes before trying to add them into a real deployment. You can run "scanstate.exe" manually to figure out if your customizations actually work - that's a lot easier than going through an hour-long process just to figure out that you missed something.
Once you've verified that your customizations work as expected, now you need to be able to tell BDD and USMT to use those new XML files. So how do you do that? Well, you need to specify the list of files on the command line that executes "scanstate.exe". But the BDD ZTIUserState.wsf script builds that command line on the fly. It uses a list property to figure out what XML files should be specified through "/i" parameters to "scanstate.exe". But if you don't specify any values for that list property, it assumes that it should use the three default files:
Remember the discussion above about USMT 3.0 being installed locally? Well, by default the original copies of these three files are installed with it. So, if you have customized these files you need to place the updated versions somewhere that the ZTIUserState.wsf script can find them. For Lite Touch, it checks a variety of locations on the deployment point:
Take your pick. The same applies for new files: just copy them into one of these folders. But for Zero Touch, it's a little more complicated, as the files need to be part of the OSD package. I would suggest the following steps:
After doing this, the updated XML files should be in the package directory on all of the SMS distribution points, and the ZTIUserState.wsf script knows to look for them there.
But how do you let the ZTIUserState know that you have new XML files that need to be added to the "scanstate" command line? Well, that goes back to the "list property" that I described above. The name of this parameter is "USMTMigFiles" and it is described in the "Configuration Reference" document like so:
List of files in XML format that are used by USMT (ScanState.exe) to identify user state migration information to be saved. When this property is not specified, the ZTIUserState.wsf script uses MigApp.xml, MigUser.xml, and MigSys.xml. Otherwise, ZTIUserState.wsf uses the files explicitly referenced in this property. The USMTMigFiles property has a numeric suffix (for example, USMTMigFiles1 or USMTMigFiles2). Note: Use this property to specify the .xml files to be used by ScanState.exe instead of using the /I parameter in the ScanStateArgs property. This prevents the ZTIUserState script from potentially duplicating the same list of .xml files.
List of files in XML format that are used by USMT (ScanState.exe) to identify user state migration information to be saved. When this property is not specified, the ZTIUserState.wsf script uses MigApp.xml, MigUser.xml, and MigSys.xml. Otherwise, ZTIUserState.wsf uses the files explicitly referenced in this property. The USMTMigFiles property has a numeric suffix (for example, USMTMigFiles1 or USMTMigFiles2).
Note: Use this property to specify the .xml files to be used by ScanState.exe instead of using the /I parameter in the ScanStateArgs property. This prevents the ZTIUserState script from potentially duplicating the same list of .xml files.
So, that means you need to configure the CustomSettings.ini rules to specify what files you want the ZTIUserState.wsf script to use. And if you specify one file, it overrides the default list of three. So let's assume that you want to use four files, the original three plus one new custom one that you've created. In this case, you'd need entries in CustomSettings.ini like so:
[Default]USMTMigFiles1=migapp.xmlUSMTMigFiles2=migsys.xmlUSMTMigFiles3=miguser.xmlUSMTMigFiles4=MyCustomFile.xml
The ZTIUserState.wsf script would look for each of these files (in the directories specified above). If found, it will copy them as long as the file doesn't already exist in the USMT installation directory on the local computer, by default C:\Program Files\USMT30. If the files do exist, but the file in the installation directory is older than the one that the ZTIUserState found on the network, the script will overlay the older file.
Now, back to the comment about config.xml above. USMT 3.0 has the ability to generate and use a configuration file which says what components from the XML file should actually be processed. By default, they all are. But if you wanted to limit that, e.g. don't migrate a particular application's settings or files, you could do that by turning off that component. The best way to go about this is to run "scanstate.exe" manually with /i parameters for each of the XML files you want to use, then specify the /genconfig parameter. This will generate an XML file with all the components that would be migrated on the current computer, but not a complete list of the available entries. Here's an example command:
scanstate.exe /i:migsys.xml /i:miguser.xml /i:migapp.xml /genconfig:config.xml
You would want to run this on a machine with most of the components present so that the config.xml has the largest number of entries, but it doesn't have to have all of them. What you will want to do then is remove the components that you want to capture, then change only the remaining entries to say that you don't want to capture them (migrate="no"). For example, if I did not want to capture Windows Media Player settings, I would end up with a config.xml file that looks like this:
<?xml version="1.0" encoding="UTF-8"?><Configuration> <Applications> <component displayname="Windows Media Player" migrate="no" ID="Settings|http://www.microsoft.com/migration/1.0/migxmlext/migapp/Windows Media Player/settings||||"/> </Applications></Configuration>
That brings us to the next challenge: making use of this customized config.xml file. Unfortunately, the BDD 2007 ZTIUserState.wsf script does not provide a simple way of specifying that a config.xml file should be specified on the dynamically-generated "scanstate.exe" command line. So, to use this config.xml file you will need to modify the ZTIUserState.wsf script. Fortunately, someone has already done that, so you can check out Jason Scheffelmaer's blog entry at http://www.deployvista.com/Blog/tabid/70/EntryID/22/Default.aspx for more details. Rest assured, we'll have this built into the next version of BDD. (At the time we released, we didn't know you could build a "subset" config.xml file, so we thought the file was machine-specific. Later we found out that wasn't true.)
See, it's all really simple :-)
Did you know that System Center Configuration Manager 2007 will include support for Wake-on-LAN? See http://www.microsoft.com/technet/prodtechnol/sms/smsv4/smsv4_help/43092b3c-06fb-4162-b589-28f14057873c.mspx for the full details, as well as Jeff Gilbert's blog posting at http://myitforum.com/cs2/blogs/jgilbert/archive/2006/08/08/22911.aspx.
So what is Wake-on-LAN? It's a way to send a "magic packet" to a machine that isn't powered on. That package is received by the still-powered-up network card, and that causes the machine to be powered on. The Wikipedia entry at http://en.wikipedia.org/wiki/Wake-on-LAN provides a good overview, and the links at the bottom provide the historical perspective.
But there is no discussion about the different ways of implementing Wake-on-LAN, or the potential security implications of each of those ways. So let's go through those:
You can then build solutions on top of those three basic implementation types. The most common method is to build a "relay agent". In this situation, the agent receives a unicast request from a server (typically a TCP conversation, point-to-point), and performs a limited broadcast on its segment, e.g. Server A instructs Workstation B to wake Workstation C that is on the same segment, so B sends the magic packet.
So the agent approach can eliminate the directed broadcast security issue, but there is the added overhead of deploying those agents (not to mention that they need to be secure too, otherwise they can be "hijacked" to perform a denial-of-service attack).
Another option: Securing directed broadcast. You can take advantage of the ability of Cisco and other routers to configure "access control lists", limiting what different hosts can do. The router can be configured to accept directed broadcasts only from certain hosts and only certain protocols and ports. For example, you could permit only a single server to send only UDP directed broadcasts, and only on a user-defined port. (See the "ip directed-broadcast [access-list-number]" command in the Cisco IOS documentation.) That would significantly reduce the potential of denial-of-service attacks as it would require that your server (the one granted access through the ACLs) be compromised, and that the attacker know which port has been opened.
Another interesting option is to not use Wake-on-LAN at all. Intel has a new hardware feature called "iAMT" (see http://www.intel.com/technology/manage/iamt/) that uses a management processor on the motherboard (similar to what has been used in servers for several years) that you can communicate with out-of-band, even when the computer is off. It uses HTTP (web) requests to directly talk to the computer, so no broadcasts are required.
So back to where we started: ConfigMgr 2007's support of Wake-on-LAN. It supports both the "directed broadcast" method and the "unicast" method described above. For many of you, that will be all you need, but there are other third-party options available too that should integrate well into ConfigMgr 2007.
A new BDD 2007 overview demo was posted to the web today, available at http://www.microsoft.com/technet/desktopdeployment/demos/index.html. If you don't know what BDD 2007 is and want more information, check it out.