#143548 - 2005-07-13 09:54 PM
Netdom
|
nervyg
Fresh Scripter
Registered: 2005-07-13
Posts: 7
|
Hi, I am very new to all this scripting. I have just started a new job and they are getting me some trainin on scripting, however, it seems that they will be getting me the training....after I have already did the project requiring it. Anyway, what I need is a script to enable me to rename a few hundred computers in our domain remotely based on a spreadsheet/textfile/whateverfile with the oldnames and new names in it. I have been scouring the internet trying to pick up tidbits. I didn't understand any vb scripts and haven't found exactly what I am looking for anywhere else. From this forum I have found out about NETDOM and have been trying to use it for the last day, However, I cannot get it to work, some type of error that I am making. If anybody has a script made, or can give an example of a NETDOM batch file or anything I would greatly appreciate it.
Thanks
|
|
Top
|
|
|
|
#143550 - 2005-07-13 10:05 PM
Re: Netdom
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
rename remotely?
XP or win2k?
NTDS or AD?
|
|
Top
|
|
|
|
#143551 - 2005-07-13 10:08 PM
Re: Netdom
|
nervyg
Fresh Scripter
Registered: 2005-07-13
Posts: 7
|
Hi and thanks for the welcome The domain is a active directory domain. It is native 2000 and the OS's are a mixture of XP and 2000. I do full admin rights for the OU and it is a single domain. Thanks
|
|
Top
|
|
|
|
#143553 - 2005-07-13 10:24 PM
Re: Netdom
|
nervyg
Fresh Scripter
Registered: 2005-07-13
Posts: 7
|
We have a group set up on the local machines that I am a part of that gives me local admin rights to the pc.
netdom renamecomputer rgmcistr18 /newname:rgmcsctest /userD:domain\user /passwordd:* /usero:administrator /passwordo:* /reboot:60
This is all I can get to even run, but it still doesn't work, and even if it did, it only would get me to change the name on the of one machine at a time. I am using the netdom that is being downloaded off of Microsoft right now. I don't know how to find the exact version.
|
|
Top
|
|
|
|
#143554 - 2005-07-13 10:37 PM
Re: Netdom
|
nervyg
Fresh Scripter
Registered: 2005-07-13
Posts: 7
|
OK, I was able to get the netdom command to work 1 computer at a time. What I really need to know is how would I set it up to look at a list and put a specific machine name in one spot and a specific new name in the other spot. This would allow me do all 300 in a moments notice. Thanks
|
|
Top
|
|
|
|
#143556 - 2005-07-13 10:47 PM
Re: Netdom
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11628
Loc: CA
|
example
Code:
Break On
Dim $Computers,$Computer $Computers=ReadFile(@ScriptDir+'\'+'workstations.txt') For Each $Computer In $Computers If $Computer $Computer ? ;SHELL '%COMSPEC% /e:1024 /c NETDOM and your switches' EndIf Next
Function ReadFile($file) Dim $lf, $f, $_, $t $lf=CHR(10) $f=FreeFileHandle $_=Open($f,$file) If @ERROR Exit @ERROR EndIf Do $t=$t+$lf+ReadLine($f) Until @ERROR $_=Close($f) $ReadFile=Split(SubStr($t,2),$lf) EndFunction
|
|
Top
|
|
|
|
#143557 - 2005-07-13 10:53 PM
Re: Netdom
|
nervyg
Fresh Scripter
Registered: 2005-07-13
Posts: 7
|
NTDOC thanks so much already, I do have full rights for the OU and all the computers this will be done to. I see where you are going with the Code: I can semi. read it and understand it but if POSSIBLE could you do a breakdown of what the code means, like I said I really am a newbie. I am signed up for a class but it will only help me for the scripts later in this project. Thanks
|
|
Top
|
|
|
|
#143559 - 2005-07-13 11:36 PM
Re: Netdom
|
nervyg
Fresh Scripter
Registered: 2005-07-13
Posts: 7
|
Les, I have tried searching for NETDOM5 a few different ways, I have found information but not your renamee script. Do you remember the thread or can you repost it??? Thanks
|
|
Top
|
|
|
|
#143563 - 2005-07-14 12:34 AM
Re: Netdom
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11628
Loc: CA
|
Here is the link I'm sure Les was speaking of
kform: Rename computers
Here are some other links to perhaps review for further information on the topic.
Rename Workstation
How do I run NETDOM NT5 on NT4 to join AD domain
The JoinAD KiXform I did a LONG time ago only moves the computer it does not rename though with some minor updates I'm sure it would work, but Les' script looks to be a good fit here.
Edited by NTDOC (2005-07-14 12:37 AM)
|
|
Top
|
|
|
|
#143564 - 2005-07-14 04:34 PM
Re: Netdom
|
nervyg
Fresh Scripter
Registered: 2005-07-13
Posts: 7
|
Thanks for everyones help. I was able to make a batch file using the NETDOM command and run it against the 300 computers. It worked fine.
|
|
Top
|
|
|
|
#143566 - 2005-07-19 02:33 AM
Re: Netdom
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11628
Loc: CA
|
Here are download links for the latest versions of the tools mentioned.
NETUSERS http://www.optimumx.com/ http://www.optimumx.com/download/
The latest NETDOM 5.2.3790.1830 tool can be found here Windows Server 2003 Service Pack 1 32-bit Support Tools
Download Link: http://www.microsoft.com/downloads/detai...;displaylang=en File Name: WindowsServer2003-KB892777-SupportTools-x86-ENU.exe Version: SP1 Date Published: 3/30/2005 Language: English Download Size: 5336 KB
KB Article: Windows Server 2003 Service Pack 1 Support Tools http://support.microsoft.com/kb/892777
MORE INFORMATION Windows Server 2003 SP1 includes updates for the following Support Tools: • Acldiag.exe • Adsiedit.msc • Bitsadmin.exe • Dcdiag.exe • Dfsutil.exe • Dnslint.exe • Dsacls.exe • Iadstools.dll • Ktpass.exe • Ldp.exe • Netdiag.exe • Netdom.exe Version 5.2.3790.1830 • Ntfrsutl.exe • Portqry.exe • Repadmin.exe • Replmon.exe • Setspn.exe
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1188 anonymous users online.
|
|
|