# Sunday, June 22, 2008

I'm not sure how I missed this one or how long it has been available but you can download the source code for MDT 2008 from Microsoft Download. You can learn a lot about how MDT 2008 works and also a lot about managed MMC snap-ins from the MDT 2008 source code. Click here to download.

posted on Sunday, June 22, 2008 10:18:04 PM (E. Australia Standard Time, UTC+10:00)  #    Comments [0]
# Tuesday, June 17, 2008

I spotted an article on Micheal Niehaus' blog the other day about moving to a single partition when doing OS deployments. You can read the article here.

This very issue arose in the project I am currently involved in and after trying reading and implementing Micheal's post I found a couple of nuances:

  • If there is an OEM partition (like WinRE) then you risk deleting you're OS partition. OEM partitions are often a hidden partition (Type 0x27) at the start of the disk that allow OEM's to offer a recovery environment for their customers.
  • If there is more than a one extra partition on the disk then ExtendOemPartition=1 won't really work.

I thought the problem deserved some more attention so I've written a script to be included in the "Refresh only" section of "Preinstall" in the Task Sequence that you use to deploy you're image. The script queries WMI to find how many partition are on the disk that contains C:. If there are any partitions after the C: partition they are removed using diskpart "delete partition".

Any comments or suggestions please let me know!

posted on Tuesday, June 17, 2008 2:26:12 PM (E. Australia Standard Time, UTC+10:00)  #    Comments [0]
# Friday, May 30, 2008

I laughed myself silly yesterday when I received an email from Microsoft Support with the following:

"I am sorry for the late reply. Unfortunately our Microsoft network is down since last week. All the domain controllers had to rebuild again. The email system is down, internet is down. So we are unable to communicate with our existing customers.

I will contact you as soon our infrastructure is ready.

Sorry for inconvenient."

Best excuse for poor service from Microsoft yet!

posted on Friday, May 30, 2008 12:47:40 PM (E. Australia Standard Time, UTC+10:00)  #    Comments [0]
# Wednesday, May 28, 2008

So once you've created a Distribution share with MDT at some point you're going to need a LAB Deployment point. Creating and updating Deployment Points is managed via [Microsoft.BDD.ConfigManager.Manager] in Microsoft.BDD.ConfigManager.dll.

To get stared you need need a DeployManager:
[System.Reflection.Assembly]::LoadFile("C:\Program Files\Microsoft Deployment Toolkit\Bin\Microsoft.BDD.ConfigManager.dll") | Out-Null
$manager = [Microsoft.BDD.ConfigManager.Manager]
$deployManager = $manager::DeployManager

Once you've got a DeployManager you can create a new deployment point using CreateNew(). This returns a generic deployment point which you can then specify what type and settings you need for the deployment point. Specifying the type and settings (ie. all the options on the General, Rules, WinPE tabs) is done by setting some properties on the deployment point object like so:

$deploymentPoint = $deployManager.CreateNew()
$deploymentPoint["Name"] = "LAB"
$deploymentPoint["Type"] = "LAB"
$deploymentPoint["NetworkShare"] = $NetworkShare
$deploymentPoint
["LocalSharePath"] = $LocalSharePath
$deploymentPoint
["GenerateLiteTouchISO"] = $true
$deploymentPoint["GenerateLiteTouchFlatISO"] = $false
$deploymentPoint["GenerateGenericISO"] = $false
$deploymentPoint["GenerateGenericFlatISO"] = $false

This is not a complete list of properties but it gives you the right idea. Once you have a deployment point you also need to specify which Applications, Task Sequences and Driver Groups you wish to include. For a LAB deployment point this is all of them:

$applicationRow = $deploymentPoint.CreateNewChild("Application")
$applicationRow["Application_Column"] = "*"
$deploymentPoint.AppendChild("Application", $applicationRow)

$taskSequenceRow = $deploymentPoint.CreateNewChild("TaskSequence")
$taskSequenceRow["TaskSequence_Column"] = "*"
$deploymentPoint.AppendChild("TaskSequence", $taskSequenceRow)

$driverGroupRow = $deploymentPoint.CreateNewChild("DriverGroup")
$driverGroupRow["DriverGroup_Column"] = "*"
$deploymentPoint.AppendChild("DriverGroup", $driverGroupRow)

After we've made all the changes we want you need to commit all the changes:
$deploymentPoint.Update()

The other really nice part about using MDT from powershell is the Bootstrap and CustomSettings writers that are built in. For example, if I want to add some lines to Bootstrap and CustomSettings.ini for the deployment point I've just created:

#Update the Bootstrap.ini file
$deploymentPoint.Bootstrap.Write("Default", "DeployRoot", $NetworkShare)
$deploymentPoint
.Bootstrap.Write("Default", "KeyboardLocale", "en-AU")
$deploymentPoint
.Bootstrap.Write("Default", "SkipBDDWelcome", "YES")

#Write Some default values to the CustomSettings.ini file
$csIni = $deploymentPoint.CustomSettings
$csIni.Write("Default", "_SMSTSORGNAME", "Windows XP Build Process")
$csIni.Write("Default", "UserDomain", "LAB")
$csIni.Write("Default", "KeyboardLocale", "en-AU")
$csIni.Write("Default", "SkipBDDWelcome", "YES")

For an end-to-end example have a look at Create-LABDeploymentPoint.zip (1.4 KB). This script sets up a lab deployment point and sets a bunch of settings that I use for XP deployments. If you want to test it out without breaking your existing LAB deployment point change line 23 to LAB_TEST.

posted on Wednesday, May 28, 2008 10:48:43 AM (E. Australia Standard Time, UTC+10:00)  #    Comments [0]
# Tuesday, April 29, 2008

I've been playing with automating MDT 2008 using Powershell and thought I'd start to share some of the info over the next few weeks.

The very first thing you need to do in MDT is create a Distribution Share. It turns out this is exceptionally easy in Powershell. The Microsoft.BDD.ConfigManager.Manager namespace has a method called UpgradeDistributionShare(string location, bool update). Just pass in the location you'd like to create the distribution share at and you're done! You can set update to true if you are upgrading an existing Distribution Share to MDT 2008.

Here is the code:

Param
(
   [
string]$Location =$(throw "You must specify a Location")
)

#Initialize MDT
[System.Reflection.Assembly]::LoadFile("C:\Program Files\Microsoft Deployment Toolkit\Bin\Microsoft.BDD.ConfigManager.dll") | Out-Null
$manager = [Microsoft.BDD.ConfigManager.Manager]

#Create a new MDT Distribution Share
$manager::UpgradeDistributionShare($Location, $false)

posted on Tuesday, April 29, 2008 1:36:55 PM (E. Australia Standard Time, UTC+10:00)  #    Comments [0]
# Tuesday, April 22, 2008

Quite frequently I underestimate how much space my Virtual Machines need, particularly when doing work with MDT 2008 and SMS 2003. This is exactly what happened today and my SMS virtual wasn't happy that it had less than 100Mb space on C:. Fortunately it is really easy to resize a vmdk file. I resized my SMS OS partition using the following command:

vmware-vdiskmanager.exe -x 15Gb D:\Virtuals\LABSRV02\Labsrv02.vmdk

This only gets us part way there though. If you were to start the virtual machine after doing the resize with vmware-vdiskmanager.exe windows would indeed see the new space but the partition would be the same size. I've noticed that a lot of people use GParted but there is an alternative, WinPE.

Attach a WinPE 2 iso to your VM and boot into WinPE. Then run the following:

diskpart.exe
select disk 0
select partition 1
extend

The commands above assume that you are resizing the first partition on the first disk. Using extend will only work if the partition you are trying to extend is the last partition on the disk. You can get more information about diskpart here and more information about using the extend command here.

posted on Tuesday, April 22, 2008 1:19:01 PM (E. Australia Standard Time, UTC+10:00)  #    Comments [1]

I just noticed a couple of guys I've work with lately have started blogging. These guys really know their stuff so you should go take a look:

posted on Tuesday, April 22, 2008 11:12:07 AM (E. Australia Standard Time, UTC+10:00)  #    Comments [0]
# Monday, March 10, 2008

There seems to be a bit of confusion around the place about installing the .NET Framework 3.5 and it's prerequisites. Firstly I'll say that the .NET Framework 3.5 standalone redistributable package available from the Microsoft Download Center contains all the prerequisites for .NET 3.5 except the Windows Installer 3.1 Redistributable. Yes it's true, everything you need is in the one file: dotnetfx35.exe.

Secondly there is some great information on deploying the .NET Framework 3.5 on MSDN at http://msdn2.microsoft.com/en-us/library/cc160717.aspx.

You will see from the article above you can silently install the .NET Framework 3.5 but running the following command:

  • dotnetfx35.exe /q /norestart

Wow! Couldn't be easier! However what if you're in an environment where everything is installed via MSIs and undergoes a certain degree of package standardization before deployment??? I found myself in this situation and as it turns out there is a lot of information available on this as well. Aaron Stebner has a wealth of information on installing the .NET Framework. In particular:

There is also a batch script at the bottom of http://msdn2.microsoft.com/en-us/library/cc160717.aspx for creating the Administrator installation points. I had a few problems with the script on MSDN so I used my own version which is included below. Download dotnetfx35.exe from Microsoft Downloads and place it in a temp folder somewhere under a directory called 3.5. I used C:\netFramework\3.5 as my location. Then copy the batch file below into a file called Create35AdminInstall.cmd under C:\netFramework. Double-Click the Batch file and you're away!! When the script is finished you will end up with admin install points for:

  • MSXML Parser 6 - msiexec /i netfx35_deploy\AdminInstallPoint\MSXML6_x86\msxml6.msi /qb-
  • RGB Rasterizer - msiexec /i netfx35_deploy\AdminInstallPoint\RGBRAST_x86\RGB9RAST_x86.msi /qb-
  • .NET Framework 2.0 SP1 - msiexec /i netfx35_deploy\AdminInstallPoint\NETFX20_x86\netfx20a_x86.msi /qb VSEXTUI=1
  • .NET Framework 3.0 SP1 - msiexec /i netfx35_deploy\AdminInstallPoint\NETFX30_x86\netfx30a_x86.msi /qb VSEXTUI=1
  • .NET Framework 3.5 - msiexec /i netfx35_deploy\AdminInstallPoint\netfx35_x86\vs_setup.msi  /qb VSEXTUI=1

Enjoy!

Create35AdminInstall.cmd

@Echo Off
set WORKFOLDER=%~dp0netfx35_deploy
set dotNetFX35build=%WORKFOLDER%\dotnetfx35.exe
echo Creating Admin Install points for NETFX3 %PROCESSOR_ARCHITECTURE%

REM Create folders where work will be done
md "%WORKFOLDER%\extracted"
md "%WORKFOLDER%\AdminInstallPoint"
md "%WORKFOLDER%\logs"
pushd %WORKFOLDER%

REM Extract the files from the NETFX35 redist SFX
Echo Extract the files from the NETFX35 redist SFX
call "%~dp03.5\dotnetfx35.exe" /q /x:"%WORKFOLDER%\extracted"

REM ------------------------------------------------------------
REM create the MSXML6 x86 admin install point
Echo Create the MSXML6 x86 admin install point
md "%WORKFOLDER%\AdminInstallPoint\MSXML6_x86"
call msiexec /a "%WORKFOLDER%\extracted\wcu\dotNetFramework\dotNetFX30\x86\msxml6.msi" /qb /l*v "%WORKFOLDER%\logs\MSXML6_x86.log" Targetdir="%WORKFOLDER%\AdminInstallPoint\MSXML6_x86"

REM ------------------------------------------------------------
REM create the RGBRAST x86 admin install point
Echo Create the RGBRAST x86 admin install point
md "%WORKFOLDER%\AdminInstallPoint\RGBRAST_x86"
call msiexec /a "%WORKFOLDER%\extracted\wcu\dotNetFramework\dotNetFX30\RGB9RAST_x86.msi" /qb /l*v "%WORKFOLDER%\logs\RGBRAST_x86.log" REBOOT=ReallySuppress Targetdir="%WORKFOLDER%\AdminInstallPoint\RGBRAST_x86"

REM ------------------------------------------------------------
REM Extract NETFX 35 x86 components
Echo Extract NETFX 35 x86 components
md "%WORKFOLDER%\extracted\netfx35_x86"
call "%WORKFOLDER%\extracted\wcu\dotNetFramework\dotNetFX35\x86\netfx35_x86.exe" /q /x: "%WORKFOLDER%\extracted\netfx35_x86"

REM ------------------------------------------------------------
REM create the NETFX35 x86 admin install point
Echo Create the NETFX35 x86 admin install point
md "%WORKFOLDER%\AdminInstallPoint\netfx35_x86"
call msiexec /qb /a "%WORKFOLDER%\extracted\netfx35_x86\vs_setup.msi" USING_EXUIH=1 REBOOT=ReallySuppress /l*v "%WORKFOLDER%\logs\netfx35_x86.log" TARGETDIR="%WORKFOLDER%\AdminInstallPoint\netfx35_x86"

REM ------------------------------------------------------------
REM create the NETFX20 x86 SP1 admin install point
Echo Create the NETFX20 x86 SP1 admin install point

REM 2.0 SP1 files location
Set fx20=%WORKFOLDER%\extracted\wcu\dotNetFramework\dotNetFX20\
md "%WORKFOLDER%\AdminInstallPoint\NETFX20_x86"
call msiexec /a "%fx20%netfx20a_x86.msi" TARGETDIR="%WORKFOLDER%\AdminInstallPoint\NETFX20_x86"
call msiexec /a "%WORKFOLDER%\AdminInstallPoint\NETFX20_x86\netfx20a_x86.msi" PATCH="%fx20%ASPNET.msp;%fx20%CLR.msp;%fx20%CRT.msp;%fx20%NetFX_CA.msp;%fx20%NetFX_Core.msp;%fx20%NetFX_Other.msp;%fx20%PreXP.msp;%fx20%WinForms.msp;%fx20%DW.msp" USING_EXUIH=1 REBOOT=ReallySuppress /l*v "%WORKFOLDER%\logs\netfx20_x86.log"


REM msiexec.exe /i c:\netfx20sp1\x86\AIP\netfx20a_x86.msi /l*v %temp%\netfx20sp1x86log.txt /qb VSEXTUI=1

REM ------------------------------------------------------------
REM create the NETFX30 SP1 x86 admin install point
Echo Create the NETFX30 x86 SP1 admin install point

REM 3.0 SP1 files location
Set fx30=%WORKFOLDER%\extracted\wcu\dotNetFramework\dotNetFX30\
md "%WORKFOLDER%\AdminInstallPoint\NETFX30_x86"
call msiexec /a "%fx30%netfx30a_x86.msi" TARGETDIR="%WORKFOLDER%\AdminInstallPoint\NETFX30_x86"
call msiexec /a "%WORKFOLDER%\AdminInstallPoint\NETFX30_x86\netfx30a_x86.msi" PATCH="%fx30%WCF.msp;%fx30%WCS.msp;%fx30%WF.msp;%fx30%WPF1.msp;%fx30%WPF2.msp;%fx30%WPF_Other.msp;%fx30%XPS.msp;%fx30%WF_32.msp;%fx30%WPF2_32.msp;%fx30%WPF_Other_32.msp" USING_EXUIH=1 REBOOT=ReallySuppress /l*v "%WORKFOLDER%\logs\netfx30_x86.log"

pause

The batch file can be download here:Create35AdminInstall.zip (1.87 KB)
posted on Monday, March 10, 2008 1:11:18 PM (E. Australia Standard Time, UTC+10:00)  #    Comments [0]

You may remember a post I did a little while ago about sorting applications in the Applications.xml file within BDD 2007. Well it seems that the Microsoft Deployment Toolkit suffers from the same problem as BDD 2007 so I've added a version to support MDT as well. You can get the new version from the original post here.

posted on Monday, March 10, 2008 12:41:14 PM (E. Australia Standard Time, UTC+10:00)  #    Comments [0]
# Tuesday, February 05, 2008

The Automated Installation Kit (AIK) for Windows Vista SP1 and Windows Server 2008 has been released head over here to get it.

posted on Tuesday, February 05, 2008 10:52:45 AM (E. Australia Standard Time, UTC+10:00)  #    Comments [0]