Archive for April, 2008

MDT 2008 and Powershell: Creating a distribution directory

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:

1
2
3
4
5
6
7
8
9
10
11
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)
Read more

Resizing a VMDK file that holds the boot partition

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:

1
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:

1
2
3
4
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.

Read more

Two Blogs you should go read!

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:

Read more