Page 1 of 2 12>
Topic Options
#63152 - 2002-02-15 04:35 PM Rename Workstation
gdalinis Offline
Fresh Scripter

Registered: 1999-12-07
Posts: 27
Hi All,

I was working on a script to rename the workstation name. I have a ghost image (trying to get rid of it) and autologon when first boots and runs the following script:

    ;writevalue("HKEY_CURRENT_USER\Volatile Environment","LOGONSERVER","\\$compname","REG_SZ")
    ;writevalue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","DefaultDomainName","$compname","REG_SZ")
    ;writevalue("HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName","ComputerName","$compname","REG_SZ")
    ;writevalue("HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName","ComputerName","$compname","REG_SZ")
    ;writevalue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","Hostname","$compname","REG_SZ")
    ;addkey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Ncpa\CurrentVersion\ConfigChanged")

The beginning of each line begins with a ; so if it wraps, sorry. I don't know how to make it smaller. Anyways, in the beginning of the script, it prompts for $compname and after the input is recieved, it runs through and does the renames. After its done, it reboots and I have another script run that joins it to the domain. After its done it reboots again and gives the login screen. Well, when I do this and try to login to the domain, I get a trust error. If I run script, reboot, and manually join to the domain I get the same problem so its somewhere in renaming the workstation. I looked at previous postings and couldn't find anything that wasn't free. Can anybody help? I hope I explained as detailed as possible. Thanks in Advanced.

_________________________
Gus Dalinis Systems Analyst

Top
#63153 - 2002-02-16 12:11 AM Re: Rename Workstation
Anonymous
Unregistered


have a look here :
http://www.swynk.com/winscript/SCRIPT_RenameWorkstationVBS.asp

"netdom.exe" from w2k resource kit is really powerful. It can perform tasks like join/remove from domain, or query active directory for servers and workstations on an eye blink. The above script is based on that.
ps1.You have change ths sid or you have run the sysprep, haven't you ?
ps2. Are you from Greece ?

[ 16 February 2002: Message edited by: novastar ]

Top
#63154 - 2002-02-16 04:13 PM Re: Rename Workstation
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I don't understand why so many people try to hack this into place when M$ provides the SysPrep and Setupcl tools. All you need is to put the info in the SysPrep.inf file and you're good to go.
If you Ghost (TM) images, it is imperative that each PC have a unique SID and while different ghosting software have their own SID changer, M$ will only support SysPrepped builds.
To learn more about SysPrep, search TechNet for "Automating Windows 2000 Deployments with Sysprep".
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#63155 - 2004-02-27 04:16 PM Re: Rename Workstation
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22335
Loc: OK
doh, yes, sysprep may support sid changes but is not so helpfull on the compname part
_________________________
!

download KiXnet

Top
#63156 - 2004-02-27 04:25 PM Re: Rename Workstation
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
A) You're resurrecting a two-year old thread!

B) SYSPREP installs have the ability to rename computers.
_________________________
There are two types of vessels, submarines and targets.

Top
#63157 - 2004-02-27 11:15 PM Re: Rename Workstation
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1338
Loc: NL
In the past I have used GhostWalker for such things...
_________________________
Co


Top
#63158 - 2004-02-28 05:17 PM Re: Rename Workstation
pvds Offline
Hey THIS is FUN
*****

Registered: 2001-04-14
Posts: 201
Maby you can take a look here? NewSID

Top
#63159 - 2004-02-28 09:50 PM Re: Rename Workstation
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22335
Loc: OK
jens:
a) did it on purpose
b) like said, sysprep is not that flexible in this without creating your own custom script and then it's no more sysprep... and in first place it's basically not sysprep but the unattended install system beneath
_________________________
!

download KiXnet

Top
#63160 - 2004-03-03 07:17 AM Re: Rename Workstation
Walshie Offline
Lurker

Registered: 2004-03-03
Posts: 3
I have written an application in C# to rename a computer name, i do the same thing as you, have autologon, but after ghosting i use ghstwalk from symantec, i script that into the ghost process, after that finished machine restarts and computer name gets changed after autologon finished

send me an email to christopher.walsh@qr.com.au and i will send you the code example


Top
#63161 - 2004-03-03 08:14 AM Re: Rename Workstation
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22335
Loc: OK
well, I do the rename in minisetup.
fire up kixforms and ask for the compname along with the additional soft to install.
once continue pressed, check the domain for same compname, if there, give an error and ask for another name.
_________________________
!

download KiXnet

Top
#63162 - 2004-03-03 11:01 AM Re: Rename Workstation
otf Offline
Getting the hang of it

Registered: 2003-11-21
Posts: 53
Loc: Scotland
thanks for that link,
we use ghosting all the time!

Top
#63163 - 2004-03-08 05:37 PM Re: Rename Workstation
maiike Offline
Fresh Scripter

Registered: 2002-11-27
Posts: 25
Loc: France
Here were my thoughts :

I wanted to rename the computers according to a file containing MAC Adresses for instance, so that it'd be completely automatic.

Explanation :
The computer would receive the ghost image, execute the minisetup, autologon, change its name reading in a file where its name corresponds to its MAC address, join the domain and tadaaa !
That's for complete disaster recovery with no user input at all...

Tell me what you think.

I love this BBS

Top
#63164 - 2004-03-08 05:44 PM Re: Rename Workstation
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
Yes, doable via the NETSET.EXE utility. See http://support.microsoft.com/default.aspx?scid=kb;[LN];268781
_________________________
There are two types of vessels, submarines and targets.

Top
#63165 - 2004-03-08 05:50 PM Re: Rename Workstation
maiike Offline
Fresh Scripter

Registered: 2002-11-27
Posts: 25
Loc: France
wow that's what I love about this, the super fast response...Thanks

Top
#63166 - 2004-03-09 05:34 AM Re: Rename Workstation
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22335
Loc: OK
hmm...
not fully done with my sysprep package but it does the rename in minisetup thus removing 1 reboot need.
on the first boot, autologon and install optional software unattended and join to domain.
during next reboot, computer is fully corp-ed.
_________________________
!

download KiXnet

Top
#63167 - 2004-03-09 01:57 PM Re: Rename Workstation
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
I'm doing the renaming after SYSPREP as the user has the ability to enter a computername through KiXforms that runs after the mini-setup.
_________________________
There are two types of vessels, submarines and targets.

Top
#63168 - 2004-03-10 10:00 PM Re: Rename Workstation
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22335
Loc: OK
ja, I do the same, with kixforms, DURING the mini-setup.
like said, I save 1 boot.
_________________________
!

download KiXnet

Top
#63169 - 2004-03-10 10:19 PM Re: Rename Workstation
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
have you seen my script in (last post in thread):
http://www.kixforms.com/forum/viewtopic.php?t=143&sid=3d0c7c40615c5841385f349bd0965854

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#63170 - 2004-06-28 09:53 AM Re: Rename Workstation
AdilB Offline
Lurker

Registered: 2004-06-22
Posts: 1
Here were my thoughts :

I wanted to rename the computers according to a file containing MAC Adresses for instance, so that it'd be completely automatic.

Explanation :
The computer would receive the ghost image, execute the minisetup, autologon, change its name reading in a file where its name corresponds to its MAC address, join the domain and tadaaa !
That's for complete disaster recovery with no user input at all...

Tell me what you think.

I love this BBS


Hi

I wanted to ask you if you mayb already found an answer to your question,..
because im sitting here with this same question..
its now 2 weeks ive been looking and working on it, but it seems that something goes wrong...
if you found it mayb you can help me..
hope to hear soon from you

With kind regards

Adil B
_________________________
MUUUUUWHAIWAIAW

Top
#63171 - 2004-07-02 02:37 PM Re: Rename Workstation
GyroTwister Offline
Fresh Scripter

Registered: 2003-01-29
Posts: 15
Loc: Hoogeveen, The Netherlands
As far as i know there are two places in the registry to rename a workstation. I change them through the following scriptlines:

$rc = WriteValue ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName","ComputerName","$Asset","REG_SZ")
$rc = WriteValue ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","NV Hostname","$Asset","REG_SZ")

$Asset is a variable which I read from the DMI code of the machine.

Hereafter I reboot and call a second script which makes the machine a part of the domain, I'm using NETDOM.EXE to do this. The main lines are these:

Netdom.exe join
%COMPUTERNAME% /domain:<domainname> /userd:administrator /passwordd:<password>


_________________________
-------------------------------------------------------------- With kind regards, GyroTwister

Top
Page 1 of 2 12>


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 151 anonymous users online.
Newest Members
diefnet, Arogya, gkustra, emnipetro, Hirze
17644 Registered Users

Generated in 0.041 seconds in which 0.01 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org