[quote=“Steve Ropiak, post: 11276, member: 47”]If I run sysprep with an unattend.xml that does everything except name the computer (it prompts for that), when exactly does this script run? Is it after the mini setup is totally done? I’d like to populate this with my little powershell script that joins the domain, sets a password and activates the real administrator account, etc. Basically what I need to know if this is the last thing to execute. Thanks to all who reply.[/quote]
The stages for Windows deployment/installs can be found here:
[url]http://unattended.msfn.org/unattended.xp/[/url]
Not much has changed really in the timing of when things happen. As far as the last thing that runs, that is the RunOnceEx.cmd. It will launch anything under the system account. It still works for Vista, 7 and 8 as I’ve used it for remote users that are on dial up to send an all in one distribution with slip streamed patches and applications.
For bare metal maintain a list somewhere that a net command can fetch a name from (csv, txt), can’t find the script in the pile I have right now, but this should get you headed in the right direction. It still works for Vista and 7 incidentally. I haven’t tested it for 8 because the places I contract to are seriously looking at Ubuntu with WINE because…well, just look at 8. It’s pretty awful.
Otherwise, munge the vbscript as much as you like and it will be the LAST item on the RunOnceEx.cmd because it requires a reboot.
[SIZE=12px][FONT=Verdana][COLOR=#070f14]'Changing computer name for WNT/W2k/WXP with script:[/COLOR][/FONT][/SIZE]
[SIZE=12px][FONT=Verdana][COLOR=#070f14]sNewName = “put new name here”[/COLOR][/FONT][/SIZE]
[SIZE=12px][FONT=Verdana][COLOR=#070f14]Set oShell = CreateObject (“WSCript.shell”)[/COLOR][/FONT][/SIZE]
[SIZE=12px][FONT=Verdana][COLOR=#070f14]sCCS = “HKLM\SYSTEM\CurrentControlSet”[/COLOR][/FONT][/SIZE]
[SIZE=12px][FONT=Verdana][COLOR=#070f14]sTcpipParamsRegPath = sCCS & “Services\Tcpip\Parameters”[/COLOR][/FONT][/SIZE]
[SIZE=12px][FONT=Verdana][COLOR=#070f14]sCompNameRegPath = sCCS & “Control\ComputerName”[/COLOR][/FONT][/SIZE]
[SIZE=12px][FONT=Verdana][COLOR=#070f14]With oShell[/COLOR][/FONT][/SIZE]
[SIZE=12px][FONT=Verdana][COLOR=#070f14].RegDelete sTcpipParamsRegPath & “Hostname”[/COLOR][/FONT][/SIZE]
[SIZE=12px][FONT=Verdana][COLOR=#070f14].RegDelete sTcpipParamsRegPath & “NV Hostname”[/COLOR][/FONT][/SIZE]
[SIZE=12px][FONT=Verdana][COLOR=#070f14].RegWrite sCompNameRegPath & “ComputerName\ComputerName”, sNewName[/COLOR][/FONT][/SIZE]
[SIZE=12px][FONT=Verdana][COLOR=#070f14].RegWrite sCompNameRegPath & “ActiveComputerName\ComputerName”, sNewName[/COLOR][/FONT][/SIZE]
[SIZE=12px][FONT=Verdana][COLOR=#070f14].RegWrite sTcpipParamsRegPath & “Hostname”, sNewName[/COLOR][/FONT][/SIZE]
[SIZE=12px][FONT=Verdana][COLOR=#070f14].RegWrite sTcpipParamsRegPath & “NV Hostname”, sNewName[/COLOR][/FONT][/SIZE]
[SIZE=12px][FONT=Verdana][COLOR=#070f14]End With ’ oShell[/COLOR][/FONT][/SIZE]
[SIZE=12px][FONT=Verdana][COLOR=#070f14]MsgBox “Computer name changed, please reboot your computer”[/COLOR][/FONT][/SIZE]
If doing an in place migration of MS OS products:
What you should be asking is how do I backup meaningful data before wiping the box?
The OS and apps are one thing, but end users usually are more than a little annoyed when all their stuff is gone. Read up on USMT (User state migration tool), for FOG I would use USMT v2.0 or lower as the initialization of the deployment process. Either by command line or using the automatic UI agent.
USMT is a pile of scripts made by microsoft that go hunting for user generated stuff (docs, pics, music, video) and put it somewhere else (attached storage/USB/NAS). Later versions use the MS certificates and are very painful to get working properly without Active Directory and a file share structure/SCCM available to manage it. So word to the wise, don’t count on any version of USMT to work outside of SCCM 2007 or 2013, even then WITH SCCM it is very painful to setup.