# Friday, September 21, 2007

Last week I needed to add a large number of hotfixes to the Task Sequencer for an XP BDD 2007 build. After adding the first few by hand I quickly sought after an easier method. As I result I came up with the code below. Althougth it may not be that useful to anyone else I thought I'd post it anyway so people can start to see what is possible using Powershell with BDD.

To use this function as is you need to have a Security Updates group in the task sequencer already. Then create a directory called Hotfixes under Applications in your Distribution point. Download the hotfix into the hotfixes directory and then run Add-Hotfix "hotfixname" "Path to TS.xml". So for a hotfix called WindowsXP-KB923191-x86-ENU.exe you would type something like: Add-Hotfix "WindowsXP-KB923191-x86-ENU" "C:\Data\TS.xml"

function Add-Hotfix ([string] $hotfix, [string]$TSFile) {
   $ts = [xml](Get-Content -read -1 $TSFile)
   $updates = $ts.psbase.SelectSingleNode("//group[@name='Security Updates']")

   $step = $ts.CreateElement("step")

   $name = $ts.CreateAttribute("name")
   $name.psbase.Value = "Microsoft Update - " + $hotfix
   $step.SetAttributeNode($name)

   $disable = $ts.CreateAttribute("disable")
   $disable.psbase.Value = "false"
   $step.SetAttributeNode($disable)

   $continueOnError = $ts.CreateAttribute("continueOnError")
   $continueOnError.psbase.Value = "false"
   $step.SetAttributeNode($continueOnError)

   $successCodeList
= $ts.CreateAttribute("successCodeList")
   $successCodeList.psbase.Value = "0 3010"
   $step.SetAttributeNode($successCodeList)

   $description
= $ts.CreateAttribute("description")
   $description.psbase.Value = ""
   $step.SetAttributeNode($description)
   
   $startIn
= $ts.CreateAttribute("startIn")
   $startIn.psbase.Value = "%DEPLOYROOT%\Applications\Hotfixes"$step.SetAttributeNode($startIn)

   $action
= $ts.CreateElement("action")
   $action.psbase.InnerText = $hotfix + ".exe /quiet /passive /norestart"
   $step.AppendChild($action)

   $updates
.AppendChild($step)
   
   $ts
.Save($TSFile)
}

posted on Friday, September 21, 2007 1:56:09 PM (E. Australia Standard Time, UTC+10:00)  #    Comments [0]
# Thursday, September 06, 2007

The virtual machine that I have been using to do some Desktop Deployment work ran out of space today. I notice the directories taking up all the space where the RemoteInstall and Distribution directories that belong to BDD and WDS. So I decided to add another virtual disk and move those two directories.

WDS
Moving WDS was easy, stop the WDS service then do the following:

  1. Cut and Past the RemoteInstall Directory to where you'd like it.
  2. Reshare the RemoteInstall directory as REMINST
  3. Open regedit and change HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\TFTPD\Parameters\Directory to the new location of RemoteInstall.
  4. Start WDS and you're away.

BDD 2007
BDD 2007 was fairly striaght forward was well. Make sure you've closed the workbench and do the following:

  1. Move the Distribution directory to where you'd like it.
  2. Open regedit and change HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\BDD 2007\Distribution_Dir to the new location of the Distrubution directory.

You can also rename these directories as well.

There, that was fairly painless.

posted on Thursday, September 06, 2007 2:35:14 PM (E. Australia Standard Time, UTC+10:00)  #    Comments [0]
# Wednesday, September 05, 2007

I've been working with Windows System Image Manager today and found myself searching around for the right input locale to use for Australia.

Microsoft have a list of the right locales to use at http://msdn2.microsoft.com/en-us/library/ms776260.aspx

For us aussies,
Locale identifier:0x0c09
Locale: English (Australia)
Locale name: en-AU
Script tag: Latn
ANSI code page: 1252

posted on Wednesday, September 05, 2007 2:29:18 PM (E. Australia Standard Time, UTC+10:00)  #    Comments [0]