MrLudwig Posted November 22, 2007 Posted November 22, 2007 Hi, I want to write a couple of batch files that will be run automatically after a PC has been imaged using ghost. I want the batch files to rename the PC, restart it and then join it to a domain. Getting the PC to auto login and run a batch file is easy enough, but how do I rename it or add it to the domain? I know the netdom utility from one of the MS Resource Kits can do the domain join, but it seems as though the rename only works on PCs already joined to a domain. I need a way of doing it for PC's that aren’t yet on a domain. Thanks
localzuk Posted November 22, 2007 Posted November 22, 2007 Why not use sysprep before you ghost the machines? http://support.microsoft.com/kb/302577 What version of ghost are you using?
mrforgetful Posted November 22, 2007 Posted November 22, 2007 Yeh you need to sysprep before taking an image otherwise you'lll have lots of issues including SID and HAL issues. Erm, google is your friend ubt I use the following sysprep commands: sysprep -bmsd followed by sysprep -clean then sysprep -quiet -mini -reseal MY sysprep file will add the computer to the domain but I still rename them when they've finished first boot as I've not configured any autonaming yet and I just get names like 'school-123486'
localzuk Posted November 22, 2007 Posted November 22, 2007 MY sysprep file will add the computer to the domain but I still rename them when they've finished first boot as I've not configured any autonaming yet and I just get names like 'school-123486' If you go for the solution suite, it is brilliant for sysprepping. Once it has a configuration stored for a PC, reimaging is as simple as clicking Execute. The machine then names as it should be etc...
MicrodigitUK Posted November 22, 2007 Posted November 22, 2007 To change the name, all that is needed in the batch file is a line to insert a reg file and the use of reg frag file to change the key with the computer name. [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName] "ComputerName"="THE-NAME-FOR-YOUR-COMP"
MrLudwig Posted November 22, 2007 Author Posted November 22, 2007 I'm using Ghost (and GhostCast server) v8. We avoid the HAL issue by having separate images for each model of PC, and NewSID from SysInternals gets around cloned SIDs. After a sysprep'ed ghost image is cloned onto a new PC, does Windows do a mini-setup the same way it does after installation via RIS? Also, would prestaging work in this situation? I setup most of our PCs via RIS, but one room of nForce based machines refuse to work with RIS no matter what I do, so these are still done using GhostCasting. I wanted to achieve the same prestaging and domain join you get with RIS, but for the ghosted PCs, if that makes sense. Thanks
localzuk Posted November 22, 2007 Posted November 22, 2007 I'm using Ghost (and GhostCast server) v8. We avoid the HAL issue by having separate images for each model of PC, and NewSID from SysInternals gets around cloned SIDs. After a sysprep'ed ghost image is cloned onto a new PC, does Windows do a mini-setup the same way it does after installation via RIS? Yes - but you can automate all of it except the naming part (unless you use ghost solution suite, then it'll handle that too). Also, would prestaging work in this situation? I setup most of our PCs via RIS, but one room of nForce based machines refuse to work with RIS no matter what I do, so these are still done using GhostCasting. I wanted to achieve the same prestaging and domain join you get with RIS, but for the ghosted PCs, if that makes sense. I don't know that one - wouldn't see why you'd want to use RIS if you used Ghost...
mrforgetful Posted November 23, 2007 Posted November 23, 2007 Also Sysprep itself gets the SID sorted so why do you need other software for that? *remembers back to the day of Windows 98 and having to run Ghostwalker on every PC*
MrLudwig Posted November 23, 2007 Author Posted November 23, 2007 You can use the 'netdom' command to do this. How? I can get netdom to join a machine to a domain, but I need a way to rename it first. When I try using netdoms /renamecomputer switch, it fails saying the machine is not joined to a domain. Can netdom only rename machines already joined to a domain? Surely it makes more sense to rename a machine, then join it to the domain? :? Thanks
techyphil Posted November 24, 2007 Posted November 24, 2007 I used to Ghost with my own AutoIT file in steps. Step 1 - Add auto logon info to run the other autoit files in c:\autoit\autoit3.exe step2.au3 etc etc Step 2 - Used autoit to prompt for a computer name which u type in then it executed newsid.exe /a [computernameVariable] and add new autorun info into registry and remove the old autorun info. (reboot automatically) Step 3 - Obviously removes the old autorun and autologin info and uses netdom to join the domain and put pc in correct OU. I've used this on serveral ghost setups. Works 90% of the time but its a massive time saver when you've got 30-60 workstations to do. I just modify the au3 files from time to time and dump it onto the next machine for ghosting.
PiqueABoo Posted November 25, 2007 Posted November 25, 2007 Can netdom only rename machines already joined to a domain? I think that's correct, although the next version of netdom (for W2K8) definitely will rename a non-domain machine.
MrLudwig Posted November 27, 2007 Author Posted November 27, 2007 Thanks everyone. techyphil: Your method sounds exactly like what I was trying to achieve, although I hadn't thought of using AutoIT. That's a stroke of genius! :idea: Thanks again.
MkII Posted December 8, 2007 Posted December 8, 2007 there's a command line utility to name/rename machines 'off domain' here see /? for instructions
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now