Page 1 of 1 1
Topic Options
#143548 - 2005-07-13 09:54 PM Netdom
nervyg Offline
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
#143549 - 2005-07-13 10:04 PM Re: Netdom
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
Hello and welcome to the board.

Well a few more details would help.

1. NT4 Domain or Active Directory
2. If AD is it 2000 or 2003?
3. What OS are the client desktops?
4. Do you have Domain Admin rights?
5. Is it a single Domain or Multiple Domains?
6. What version of KiXtart are you using?
  

Top
#143550 - 2005-07-13 10:05 PM Re: Netdom
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
rename remotely?

XP or win2k?

NTDS or AD?
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#143551 - 2005-07-13 10:08 PM Re: Netdom
nervyg Offline
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
#143552 - 2005-07-13 10:13 PM Re: Netdom
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
Admin rights on the OU are NOT the same as Domain Admin rights. i.e. Unless you have some other group on the local machines that you're a member of you wont' be able to remotely manage them.
 
Please show us an example of what you've tried.
 
What version of NETDOM are you using?
 

Top
#143553 - 2005-07-13 10:24 PM Re: Netdom
nervyg Offline
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 Offline
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
#143555 - 2005-07-13 10:39 PM Re: Netdom
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
right click on the file and do properties and it should show you the version.

Okay, I have to run for a bit, but I'll get back with you later on this if Rad or someone else has not helped you further.

In order to rename a machine you need to have sufficient rights on the Domain to rename the machine. Are the computers within your OU? And do you have FULL rights on the entire OU?
 

 

Top
#143556 - 2005-07-13 10:47 PM Re: Netdom
NTDOC Administrator Offline
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 Offline
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
#143558 - 2005-07-13 10:55 PM Re: Netdom
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I posted my rename script complete with KiXforms GUI. Search for NETDOM5.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#143559 - 2005-07-13 11:36 PM Re: Netdom
nervyg Offline
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
#143560 - 2005-07-13 11:45 PM Re: Netdom
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
ja Les you basta. I tried searching and no can find either. Show us the code, show us the code.

-Shawn

Top
#143561 - 2005-07-13 11:57 PM Re: Netdom
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hmm...
found 1 post before this one:
http://www.kixtart.org/ubbthreads/showfl...=true#Post46022

Les says:
Quote:

You are missing the local computer creds.
/UserO:
/PasswordO:

I use NetDom5 from the forestrecovery.exe download.


_________________________
!

download KiXnet

Top
#143562 - 2005-07-13 11:59 PM Re: Netdom
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
but I think this is the closest to what anyone would call GUI:
http://www.kixforms.org/forum/viewtopic.php?t=143&highlight=netdom
_________________________
!

download KiXnet

Top
#143563 - 2005-07-14 12:34 AM Re: Netdom
NTDOC Administrator Offline
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 Offline
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
#143565 - 2005-07-14 05:45 PM Re: Netdom
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
BATch! YUCK!!
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#143566 - 2005-07-19 02:33 AM Re: Netdom
NTDOC Administrator Offline
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
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1188 anonymous users online.
Newest Members
StuTheCoder, M_Moore, BeeEm, min_seow, Audio
17884 Registered Users

Generated in 0.113 seconds in which 0.067 seconds were spent on a total of 11 queries. Zlib compression enabled.

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