# 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]
# Monday, November 26, 2007

Head on over to Richard Smith's blog to get GImageX. GImageX is a GUI for imageX. The original verison was written in AutoIT but this version has been completely rewritten in C++. The new version v2.0.1 BETA feature list on Richard's site:

  • Native x86 and x64 versions entirely written in C++.  Tiny ~100KB executable.
  • Doesn’t use the imagex.exe utility at all – instead it uses the WIMGAPI interface (the wimgapi.dll file from the imagex directory)
  • Progress bars, time elapsed, time remaining, file counts have been added
  • Clean “abort” option
  • Ability to mount, change and get info on WIM images

So what are you waiting for, click here to get it.

posted on Monday, November 26, 2007 8:58:16 AM (E. Australia Standard Time, UTC+10:00)  #    Comments [0]
# Monday, November 12, 2007

Microsoft Deployment is the next version of BDD and the final version can be download here.

The brief from MS Dowloads:
Microsoft Deployment is the next version of Business Desktop Deployment (BDD) 2007. It is the recommended process and toolset to automate desktop and server deployment. Microsoft Deployment provides detailed guidance and job aids for every organizational role involved with large-scale deployment projects.

posted on Monday, November 12, 2007 9:29:53 AM (E. Australia Standard Time, UTC+10:00)  #    Comments [0]
# Monday, November 05, 2007

You may have read an article by Ben Hunter on sorting the applications in BDD so they are easier to find when adding them to the Task Sequencer of Database Role. The article can be found here.

An issue arose the other day that necessitated the re-ordering of application in BDD. The current build process that I am working on uses Windows Powershell to do a lot of post build customizations. In testing we found that Powershell was being installed before the .Net Framework. This seemed odd to me as we are using a role to installed our Tier 1 application.

After looking into the issue a bit more it seems that BDD does not honour the order of application defined in the role but installs them in the order they are listed in Applications.xml. This was a problem for us so I set about extending the bddsort application so I could specify any order I wanted. Hence BDD Application Sorter was born.

The program is simple to use, all you need to do is open the Applications.xml file, re-order the application and save the file again. I make a back of Applications.xml just in case but I have never had an issue with the program to date.

Anyway, BDD Application Sorter is attached below. Enjoy!

BBDAppsSort.zip (13.74 KB)

Update: New Version to support Microsoft Deployment Toolkit

The version below will work for the Microsoft Deployment Toolkit
MDTAppSort.zip (23.44 KB)

posted on Monday, November 05, 2007 11:46:00 AM (E. Australia Standard Time, UTC+10:00)  #    Comments [2]
# Tuesday, October 16, 2007

I've been using BDD 2007 a lot lately and I thought it would be nice to get live logging details from BDD rather than using the many .log files that are created. After searching around for possible solution I settled on using a combination of a C# application using HttpListener and a vbscript using MSXML2.ServerXMLHTTP. The logging application is shown below.

To setup the remote logger is fairly simple and the files needed are included below. To use the remote logger do the following:

  1. Download BDD Remote Logger.zip
  2. Copy ZTIGather.xml and ZTIUtility.vbs into your Distribution$\Scripts directory. Do a file compare if you are interested in the changes. There is an addition properity added to ZTIGather.xml called RemoteLogURL and a few lines added to the Logging Class in ZTIUtility.vbs.
  3. Add RemoteLogURL=http://yourmachine:8081/
  4. Start BDDRemoteLogger.exe and ensure that the url prefix is the name of your machine. The URL Prefix in BDDRemoteLogger must match what you have in your RemoteLogURL value.
  5. Click start on BDDRemoteLogger and Run BDD as normal.

If you run BDD with RemoteLogURL present and you BDDRemoteLogger is not listening for requests then it will considerably slow down the BDD logging (approximately 1sec per entry). So if RemoteLogURL is present in Bootstrap.ini then make sure you have the logger running. If RemoteLogURL is not present BDD will run as norma.

If you've got any questions or comments please comment to this post.

BDD Remote Logger.zip (25.5 KB)
posted on Tuesday, October 16, 2007 12:23:08 PM (E. Australia Standard Time, UTC+10:00)  #    Comments [2]