Solved

How Do I Rename Multiple Computers Using Their IP Address?

Posted on 2004-09-21
8
658 Views
Last Modified: 2008-02-01
I have about 200 clients that occasionally get re-imaged. They do not belong to domains. They all have static IP addresses. Using the static IP addresses how could I write a script that would rename each computer? It doesn't matter what it names them... It would be nice if it named each one the same name every time I ran the script though I suppose. Is [HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\ComputerName\] the only registry key I need to change in order to change a computer's name? If so, how could I write a batch script that would do something like this:

Go <MACHINE IP ADDRESS> and run regedit /s \\SERVER\PUBLICSHARE\CHANGECOMPUTERNAME<COMPUTER'S IP ADDRESS>.REG

For that example I would need a reg file for every computer though. I'm sure there is some way to do it with a variable instead.... Help?
0
Comment
Question by:Grime121
  • 4
  • 3
8 Comments
 
LVL 95

Expert Comment

by:Lee W, MVP
ID: 12120046
The computer name is not simply a registry entry.  You'll likely need to use the netdom command.  For some information on this, see:

http://www.ss64.com/nt/netdom.html
http://folk.uio.no/mlomholt/ymse/hjelp/win-netdom.txt

You might also want to try looking over this:
http://www.enterpriseitplanet.com/resources/scripts_win/article.php/3081771
0
 
LVL 10

Expert Comment

by:Longbow
ID: 12120561
http://www.jsiinc.com/SUBA/tip0200/rh0285.htm

Here is the tool you need to change any computername.
You can download it from this link.

You can change a computername remotely with Psexec tool from the PsTools Suite found at http://www.sysinternals.com/ntw2k/freeware/pstools.shtml.

To automate the process from the image you need to script it.
I will suggest to have the mac address and the new computername
 in order to change it correctly.

Wich imaging system do you use ?
How do you define wich static address have each computer ?
0
 
LVL 1

Author Comment

by:Grime121
ID: 12122234
We use Symantec Ghost 8.0. All of the static IP addresses are assigned by the DHCP server according to MAC address. I already use pstools a lot, and I've been trying to figure out a way to use it for this problem since I know you can run it according to IP address. I think this will work. Here is what I'm going to use in a script for each computer:

psexec.exe \\192.168.0.x babtize <new name>
0
 
LVL 1

Author Comment

by:Grime121
ID: 12122270
Oh, one more thing. Will Netware cause any problems with this? We use Novell on these computers.
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 10

Expert Comment

by:Longbow
ID: 12122429
Your commandline must  have the path & filename in quotes.
The options can follow the last quote.

It is not an so easy thing.
Now i know you connect to differents domains :
When changing the username you need to put each computer in a workgroup, then change the computername, then put it back in the domain. It will take two or three reboots. The keyboard and mouse must be locked to prevent the users to use the computer during this session.
My script is a batch file with 116 lines of code.
It needs five executables to do all the job.

The solution i gave you is a solution to change computernames to the fly, not after ghosting a PC.
Or maybe you have a script wich does the job in one execution.
But you need to have a report because you do not know wich computer were turned on at this time.

The solution i used to ghost my training rooms is a list (.txt file) with all computernames and macaddresses in two columns.

We had a DOS tool wich read the macaddress and the computername from a floppy disk ant put the value in a environment variable.

The variable can be sent to Ghostwalker in order to change accordingly the computername.
0
 
LVL 1

Author Comment

by:Grime121
ID: 12123622
Well, all of the computers are already in workgroups. We don't use a domain for those computers. I use psexec quite frequently, so I'm pretty familiar with it. Since they are not in domains, can't I just simply run that 'babtize' script to rename them? I found an option in Ghost one time to rename computers randomly after they are imaged, but I looked for about 15 minutes yesterday and could not find it. Plus, it would be nice to assign the computers the same name every time they are imaged rather than a random name every time. I'm not too worried about which computers are turned on at the time. The computers are in labs at a university. After we image them we can just run the script for that lab that will include the renaming commands. Does this sound like a good solution?
0
 
LVL 10

Accepted Solution

by:
Longbow earned 500 total points
ID: 12124392
Yes, you can use it directly sinds you do not have to access a domain.
Psshutdown can terminate the job.

Ghostwalker is the Ghost's tool wich can change the SID and can give a computername to the computer before the first logon.
I do not remember the exact name of the file. But it is near. Ghstwlkr.exe maybe.
It is a DOS application.

If the computer needs the presence of a local administrator while ghosting, running the script locally is a good solution.

Or if you already know the IP addresses used for the network you can automate the process. See my above post.
If MAC = "XXX" Then baptize NewComputername.
One line by computer.

Here is the link to a Visual Basic Script wich gives you any info about a Network Card.
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=45
From this point your ghost image can automate the process.
0
 
LVL 1

Author Comment

by:Grime121
ID: 12129858
Wow, I found something even better: http://mytoolsandstuff.tripod.com/wsname.html

That will rename them by doing a reverse dns lookup and using whatever the PTR record is for that IP address. Very slick. Of course, the reverse lookup zone has to be set to not allow dynamic updates.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine. For this, I arranged a test scenario.I…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now