Sign in to follow this  
Followers 0
cowsmanaut

Computer name and workgroup

14 posts in this topic

#1 ·  Posted (edited)

Hi there, I've been souring the net.. I'm sure there is a way to do this but I have not yet found it. I want to change the computer name and workgroup of the computers with the script I've written to identify them. However I would really preffer not to have to use auto it to open up the properties window.. go down to the button change the name go back.. etc etc etc.

Does anyone know if there is a direct command either in CMD or in Autoit (I know I can find the name by @computername but doesn't seem to affect change) in order to change these without the long and dirty process?

Thanks

oh.. and they are all windows XP pro

Edited by cowsmanaut

Share this post


Link to post
Share on other sites



Bob... You rock! :D

Damn.. I must have been looking in the wrong places.

Anyway, tested it out after I hunted down the regfind tool.. worked like a charm.

Thanks

Now all I need is the workgroup... hmmm..

Share this post


Link to post
Share on other sites

Hi there, I've been souring the net..

ROFL :D .. was that on purpose, cow? (sorry to be so cheesy, i'm not normally this whey :huh2: )

Share this post


Link to post
Share on other sites

yeah.. I think my udders were a bit ripe.. rotten milk went everywhere :D

Oh incedently.. while sCouring the net the second time.. I found that annother tool that comes in the same set as the regfind tool (incedently neither come with windows directly but are part of a extra package) that does the same job only the line is much shorter and has nothing to do with the registry (safer) :huh2:

still nothing on the workgroup yet though.. hmmm

Share this post


Link to post
Share on other sites

bah.. somehow I keep being logged out.. how odd. Anyway.. that was me. ^

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

On NT4 I'm simply writing the new name to

HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\ComputerName
from within my cloning scripts and reboot the computer... works for about 500 computers here, no need for external utilities, etc.

EDIT: Just checked... it does NOT work on WinXP. At least it doesn't change all of the needed entries. So don't use this on WinXP!

Edited by sugi

Share this post


Link to post
Share on other sites

I just dont change the SID.

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Yes NetDom.exe is the one I'm using now instead of regfind.exe to change the computer name. However, doesn't look like it does anything with the workgroup. Perhaps I just missed that part.

Holger, using http://unattended.sourceforge.net to do your windows install and autoit to install your software you will not need to image ever again. Thus no need to change the SID at all. Part of the main reason we went to this option in the first place.

I think there may be a way to enter the workgroup from "unattended" as it installs windows. so maybe I'll hunt that down.

Oh Sugi.. that looks like it's similar to the registry entry.. do you have that portion of the code you could post? Are you using regedit or something?

moo

edit: yep.. unattended has it in advanced options

[Identification]
    JoinWorkgroup=FOOBAR

simple as that. I'll still use my code to set individual names though. Unatended has something for that based on IP like my script but is untested and I'm not 100% sure how it's operating..

Edited by cowsmanaut

Share this post


Link to post
Share on other sites

As this part of the cloning process is done using a batch file I don't have AutoIt code for this... but it's not hard to do. The following is for batch files:

reg update HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\ComputerName=%NEWCOMPNAMEUPPER%

The code uses the reg.exe utility from NT4 ressource kit but it's also possible to create a regini file to write to this key which has the advantage that regini is available on every Winodws NT based system.

This code should do the same in AutoIt3 but I haven't tested it:

RegWrite('HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName', 'ComputerName', 'REG_SZ', StringUpper($NewComputerName))

Just a small note: On Windows NT 4 the computername is usually in CAPS, so you should convert the computername to caps before writing it to this key. Don't know about Active Directory though.

Share this post


Link to post
Share on other sites

oh just to point out to others who have not yet tried this Unattended.sourceforge.net option and are still using imaging. I would completely and absolutely recomend dropping all forms of imaging in favour of this. (I had previously assumed most autoit users were doing this already)

At the college we have run into soooooo many problems using imaging. One in particular is not all images are created equal it would seem. Tiny little quirks in settings or small bugs introduced in the resut of a bad copy of just a few bytes.

Unattended will set up your windows install fast without prompting you or even showing you a single screen. Then running auto it as a part of it means I get all my programs installed. It just goes like mad. I pop in a disk.. boot it up and off it goes.. partitions, installs windows and then continues installing and doing whatever I need. all over the network.. it's not quite as fast as an image but close. And the biggest advantage is that I can use the same scripts on *ANY* machine. Even if they don't have the same hardware.. and because it's a legitimate install rather than an image.. no need to change the sid.

so.. from someone who previously loved imaging.. I'd recommend the switch.

moo

Share this post


Link to post
Share on other sites

Unattended will set up your windows install fast

It's fast when compared to installing the system by hand. But even unattended installation took 6 to 8 hours (depending on the application set) here... and that's just too long. Cloning takes around 30-60 minutes and when the clones are well maintained there are no problems.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0