Sysprep as post-installation task....problems
Given the nature of our deployment, it's easier for us to do sysprep as a post-installation task. I've successfully made a batch file that copies the unattended file and runs sysprep. However, I need to figure out how to run additional scripts after the sysprep (mainly our kbox agent, and wsname). Our naming convention is D+Servicetag for desktops, and L+servicetag - so the bulit in renaming in the sysprep unattended file won't work for us. Is there a way to run scripts after that at all?
look at this link to add commands to run on startup:
the section to add to sysprep would be
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
Guys - thanks for all of your help. The res.bat caused the problem with not allowing other scripts to run. A few MSI's that worked before sysprep/batch converter didn't work after - but had to zip them up and call them from a batch file to get it to work. A couple broken ones - but figured it out. I ran into an issue after renaming the PC, rebooting, then joining the domain - sometimes it wouldn't join...and I figured that it wasn't connecting to the network fast enough and was failing - so I put a 300mb MSI to deploy after reboot before joining the domain to give it some time.
For now it looks like it's working :) I worked for 4 months to prepare this image w/o sysprep because our guys said we didn't need it. Then the day before we image we're told we need sysprep - so it gave me very little time to learn sysprep, test deploy, and still keep on target for my deadline of imaging these 800 laptops. We have 1,000 desktops coming in 3 weeks that I'll be better prepared for now thanks to all of your help
Well in the long run we'd like to get to imaging in a half normal fashion lol. One of the things you might try is the post-install task to logon script converter. If someone would be kind enough to link that to him.
Also there are lots of scripted ways to join a domain. Everyone has their favorites.
Use this to join to specific OU. This is a snippet of what I use. Save this as a .ps1 and enter "powershell.exe -nologo -executionpolicy bypass -WindowStyle hidden -noprofile -file script.ps1" in your command line.
$oupath = 'OU=Workstations, DC=DOMAIN, DC=ORG' $username = "domain\Admin" $password = ConvertTo-SecureString "password" -AsPlainText -Force $cred = New-Object System.Management.Automation.PSCredential $username, $password Add-Computer -domainname domain.org -oupath $oupath -Credential $cred -ErrorAction silentlycontinue Add-Computer -DomainName domain.org -Credential $cred
you may want to look at this.
I have injected run once commands in my post install by doing this (this is the last line of my post install script)
start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v kclean /d "c:\kcleanup.exe"
WOW - Thanks for all the help guys. The postinsatll task converter isn't required, is it?
Ideally, I want to capture a sysprepped image. I'll get my network guys to not require us to use sysprep to join AD. After sysprep is finished (it restarts during sysprep too), it should automatically run whatever scripts I have as post-install tasks right? None of my scripts require restarts other than a pc-rename...but I think we already have a working script for pc rename & join domain.
Sorry to sound stupid - I joined here a year ago, and they've always done images w/o sysprep or newsid...now, we're deploying 2,000 machines this Summer with Windows 7 and they found out why our KMS wasn't working - they never did sysprep :) So It's new to me too!
Since you are using WIM's. A trick to save network bandwidth and k2000 diskspace you can store the Wim's on any windows server, they are not restricted to k2000 file system. I have had the server crew create storage space on all the sites and I store my Wims at each site. They created a share on the main storage server at each site named images$ and I have a K2000 domain user that has rights to these shares. I created a subdirectory called imagestore in each share (required). I Then used the KBE manipulator to create custom pxe boot environements that map the T: and W: drive to each of my storage spaces. Now when I capture a sysprepped image I choose the proper boot to map the server I want it to go to. When staff deploys, they pxe boot to the k2000 box, the machine gets it deployment orders from the k2000 and starts. I remap the W drive as my first preinstall task to the needed storage to access the WIM
net use w: /delete
net use w: \\ms-acad.tmccacad.tmcc.edu\images$ Password /user:tmccacad\K2000
The deployment starts on the K2000 and then it switches over to the storage server to copy the wim portion then switches back to the K2000. 95% of the workload is placed on the storage servers instead of the K2000. I have had 120 images deploying from a single k2000 this way and I am still able to capture my next master even when they are imaging. This also allows you access to the wims so you could use imagex commands to view or edit the file.