|
|
|||||||
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_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.
|
||||||||
|
|
|||||||
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. [ 16 February 2002: Message edited by: novastar ] |
||||||||
|
|
|||||||
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". |
||||||||
|
|
|||||||
doh, yes, sysprep may support sid changes but is not so helpfull on the compname part |
||||||||
|
|
|||||||
A) You're resurrecting a two-year old thread! B) SYSPREP installs have the ability to rename computers. |
||||||||
|
|
|||||||
In the past I have used GhostWalker for such things... |
||||||||
|
|
|||||||
Maby you can take a look here? NewSID |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
thanks for that link, we use ghosting all the time! |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
Yes, doable via the NETSET.EXE utility. See http://support.microsoft.com/default.aspx?scid=kb;[LN];268781 |
||||||||
|
|
|||||||
wow that's what I love about this, the super fast response...Thanks |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
ja, I do the same, with kixforms, DURING the mini-setup. like said, I save 1 boot. |
||||||||
|
|
|||||||
have you seen my script in (last post in thread): http://www.kixforms.com/forum/viewtopic.php?t=143&sid=3d0c7c40615c5841385f349bd0965854 |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
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> |
||||||||
|
|
|||||||
This method would leave the old computername still attached to the domain, which is not desireable. |
||||||||
|
|
|||||||
As long as there XP Workstations NETDOM can do the rename and join/move into the Domain. Microsoft Knowledge Base Article - 298593 HOW TO: Use the Netdom.exe Utility to Rename a Computer in Windows XP http://support.microsoft.com/?id=298593 |
||||||||
|
|
|||||||
NETDOM5 can rename Win2K as well. |
||||||||
|
|
|||||||
Thanks Les, Hadn't tried it and documentation only mentioned XP not 2000. |
||||||||
|
|
|||||||
Quote: never heard of netdom5. where can we get this file? we need to rename our win2k computers. |
||||||||
|
|
|||||||
From Microsoft... it is listed as an AD Recovery Tool. |
||||||||
|
|
|||||||
Best Practices: Active Directory Forest Recovery http://www.microsoft.com/windows2000/downloads/tools/default.asp |
||||||||
|
|
|||||||
Here are some updated links to help you locate the tool. Best bet would be either the Windows XP SP2 Tools update or the Server 2003 version. The link listed by Les does have the NETDOM.EXE file inside along with a whitepaper, but is an older version then the 2003 and XP SP2 version updates. Description of Netdom.exe Syntax and Versions http://support.microsoft.com/default.aspx?scid=kb;en-us;329721 Windows XP Service Pack 2 Support Tools http://www.microsoft.com/downloads/details.aspx?FamilyID=49ae8576-9bb9-4126-9761-ba8011fabf38&displaylang=en&Hash=W6YFBY9 The following Support Tools have been updated in Service Pack 2: bitsadmin.exe extract.exe httpcfg.exe iadstools.dll ipseccmd.exe netdom.exe replmon.exe How To Use the Netdom.exe Utility to Rename a Computer in Windows Server 2003 http://support.microsoft.com/default.aspx?scid=kb;en-us;325354 This article describes how to use the Netdom.exe utility (included in Windows Server 2003 Support Tools) to rename a computer that is a member of a Microsoft Windows 2000 or Windows Server 2003 domain. This procedure can be performed either locally or remotely on the computer that is being renamed. Also, the procedure does not require that you to reset or manually re-create the computer account in the domain. The Netdom.exe utility can rename a computer that is a member of a Windows Server 2003 domain. However, to rename the computer, you must specify the user accounts that have local administrative permissions and the object of the computer account in Active Directory. How To Use the Netdom.exe Utility to Rename a Computer in Windows XP http://support.microsoft.com/kb/298593/EN-US/ Windows Server 2003 Administration Tools Pack The Windows Server 2003 Administration Tools Pack (Adminpak.msi) provides server management tools that allow administrators to remotely manage Windows 2000 Servers and Windows Server 2003 family servers. This is the final version (build 3790) of the Adminpak.msi file. http://www.microsoft.com/downloads/details.aspx?FamilyID=c16ae515-c8f4-47ef-a1e4-a8dcbacff8e3&DisplayLang=en Windows Server 2003 Resource Kit Tools The Windows Server 2003 Resource Kit Tools are a set of software tools for administrators, developers, and power users to manage Active Directory, Group Policy, TCP/IP Networks, Registry, Security, Scalability and many other areas of the Windows Server 2003 operating system. http://www.microsoft.com/downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en |
||||||||
|
|
|||||||
The question was: Quote: My link is to version 5.2.3687.0 otherwise known as NETDOM5. I have used this version to rename hundreds of W2K machines using a KiXforms script that I posted on this board. |
||||||||
|
|
|||||||
This is a piece of aq kixform I wrote to join, rename, and move XP machines in AD... You will need to dig into it to get at the few lines of code that do each function. Code:
|
||||||||
|
|
|||||||
Quote: thanks...got it. |
||||||||
|
|
|||||||
Just a note: I use a free app called NEWSID to rename the workstation and change the SID. I have scripted to automatically rename PC to serial number, change SID, reboot, add to domain, reboot and so on. I have had no problems with NEWSID...also very easy to use. |
||||||||
|
|
|||||||
Just renaming a workstation does not necessitate a SID change. SIDs only need to be changed if the operating system is being cloned. And even then, the use of e.g. SYSPREP will take care of the SID-issue. Only clonign an OS after the GUI-based setup will require a SID change. |