Thursday, 7 April 2011

Procrastination is the mother of invention

So, I've basically avoided rebuilding any more PCs as yet. My official excuse is that I'm waiting for MS to come up with a fix. The more honest one is that it's a boring and long process and I'd rather work on other things. So I've been spec'ing and ordering the start of this year's hardware refresh which in turn has led me to completely rebuild my MDT/WDS server to include SP1.

It's been an interesting couple of days. Getting the MDT server up and running was as simple as ever and it's always good to see what changes have been made by the latest service packs (in my case I'm now running MDT 2010 on Server 2008 R2 SP1). There were a couple of frustrations though that I thought I'd document.

Our new laptops are Toshiba Portege R700-183 boxes. They have, of course, got a few drivers that Windows doesn't pick up and so I've been working on getting the software installed silently. The first problem I hit was with installing the Bluetooth stack. If you download the Bluetooth driver from Toshiba and extract the executable using something like 7zip, you get two batch files for silent install. Unfortunately silent_install_for_Vista_Win7.bat is badly written imo. Some lines don't account for spaces in the file path whilst others do and there's a user reboot prompt at the end of the file. So how is that silent exactly? I've pasted my amended file below. Anyway, once I'd amended the bat file and added it as an application that took care of the BlueTooth. The same process applied to the FingerPrint utility but the silent install for that one actually works out of the box.

Anyway the second problem was probably more down to me rather than anything else. I always like to have the latest drivers if I'm doing a fresh build so, wherever possible, I'll use the drivers from Windows Update rather than embedding them into MDT. I'd noticed that the video, wireless and 'intel management engine interface' drivers were all available from Windows Update along with the Toshiba HDD Protection Shock Sensor Driver, which doesn't show up as unknown hardware in Device Manager but I'll take it anyway thanks! So... I wanted to use these, but of course they're not all available via my WSUS server. The sensible solution seemed to me to create a prestage OU with Group Policy inheritance blocked, find out how to put a computer into the prestage OU when deploying via MDT and move it to the live OU at the end.

Luckily for me it's a pretty simple process thanks to the incredible development work that's gone on over at the MDT Customization Project on Codeplex. I won't replicate their work here but if you're interested in achieving the same thing I have, take a look at Maik Koster's blog post on Moving Computers in Active Directory During MDT Deployments - Step by Step. It's incredibly simple and the web service works like a dream.

So I've now got a lovely clean new image for deploying Windows 7 SP1 to any new computers. At some point next week I'll test it out on the older machines I have in case I need it for a rebulid. It'll probably need a few extra drivers but now that I've got the Windows Update step of the MDT Task Sequence pointing at Microsoft instead of my WSUS server, I'm hoping that it won't be that many.

silent_install_for_Vista_Win7.bat :

@echo off
echo Execute this script as Administrator (right mouse click on the bat-file and select "Run as administrator")
echo Silent Bluetooth stack installation in progress.
echo Please wait until it is finished.
echo ****************************************************************************

REM Removing old BT-Stack ... if installed
msiexec.exe /x"{CEBB6BFB-D708-4F99-A633-BC2600E01EF6}" /qn

REM enable AS.ini for silent installation

IF EXIST "%~dp0x64\Program Files\Toshiba\Bluetooth Toshiba Stack\AS.orig.ini" GOTO FCOPY
move "%~dp0x64\Program Files\Toshiba\Bluetooth Toshiba Stack\AS.ini" "%~dp0x64\Program Files\Toshiba\Bluetooth Toshiba Stack\AS.orig.ini"
echo Copy as.silent.ini to as.ini
copy "%~dp0as.silent.ini" "%~dp0x64\Program Files\Toshiba\Bluetooth Toshiba Stack\AS.ini"

REM Removing BTmon ... if installed
REM echo Try to remove BTmon if installed
REM "C:\Program Files (x86)\InstallShield Installation Information\{61539202-097E-487E-9237-B291AB56D54C}\setup.exe" -runfromtemp -l0x0009 -removeonly

REM Installing new BT-Stack ... in silent mode
"%~dp0x64\setup.exe" /s /v"/qn REBOOT=ReallySuppress ALLUSERS=1"

REM Restore original AS.ini
del "%~dp0x64\Program Files\Toshiba\Bluetooth Toshiba Stack\AS.ini" /F /Q /S
move "%~dp0x64\Program Files\Toshiba\Bluetooth Toshiba Stack\AS.orig.ini" "%~dp0x64\Program Files\Toshiba\Bluetooth Toshiba Stack\AS.ini"

echo ****************************************************************************
echo Suppress Wireless Warning window
REG.exe ADD "HKEY_CURRENT_USER\Software\Toshiba\WirelessAPL\BTWLANDP" /v DisplayFlag /t REG_DWORD /d 1 /f
echo ****************************************************************************
echo Disable SystemWakeup
REG.exe ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tosrfusb\Parameters" /v EnableSystemWakeup /t REG_DWORD /d 0 /f
echo ****************************************************************************


REM Following line added to make it properly silent
goto no
REM echo "Reboot now? [Yes/No]"
REM choice /C:YN
REM if ERRORLEVEL 2 goto no
REM if ERRORLEVEL 1 goto yes
REM goto start

REM :yes
REM echo Your system will reboot in a few seconds !!!
REM shutdown -r -f -t 18


No comments:

Post a Comment