• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1436
  • Last Modified:

Rename computers based on MAC Address

We have hundred of computers we image every month. It takes many days to go through this process of renaming the computers.  We have the mac addresses for all the computers.  Is there a vbs or cmd script I can run to rename all the computers based on mac address? I would like to run a script on a remote computer that is on the same subnet.

Eg: mac address = computer name
      00-23-AF-92-6F-0F=MyComputername01
     00-23-AF-92-6A-0F=MyComputername02
0
GSIAdmin
Asked:
GSIAdmin
  • 4
  • 3
1 Solution
 
mirtheilCommented:
I've used compname.exe (http://www.willowhayes.co.uk/) in the past in conjunction with a batch file in my Unattended Setup.  The batch file I used was:
ECHO.
ECHO Setting Computer Name
ECHO Please wait...
for /f "tokens=1" %%i IN ('compname /d ?m') do set MAC=%%i
IF %MAC% == 000000000000 compname /c machine1
IF %MAC% == 000000000000 compname /c machine2
0
 
GSIAdminAuthor Commented:
mirtheil,

Can I run this batch on any computer or must it be on the computer I am renaming?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
mirtheilCommented:
I was running it on the computer being renamed during the Windows  installer.  You should be able to execute the batch file on the remote machine using something like PsExec although I haven't tried it.
0
 
GSIAdminAuthor Commented:
I try above and still no luck.  Anyone else have a solution
0
 
mirtheilCommented:
What behavior did you see?  Did it not change the name?  Did you reboot the remote machine after running the command?  
0
 
GSIAdminAuthor Commented:
mirtheil,

Thanks for the reply, this is what I got from the command prompt.  

C:\>TEST.BAT

C:\>ECHO.


C:\>ECHO Setting Computer Name
Setting Computer Name

C:\>ECHO Please wait...
Please wait...

C:\>for /F "tokens=1" %i IN ('compname /d ?m') do set MAC=%i
'compname' is not recognized as an internal or external command,
operable program or batch file.
compname was unexpected at this time.

C:\>IF  == 001E68AEF04E compname /c TEST1
0
 
GSIAdminAuthor Commented:
Mirtheil,

It worked, I did not follow the instruction.  After I downloaded compnam.exe, I was able to rename my computer.  Tomorrow, I am going to test this on our network.  Will this allow me to rename all the computer all at once without going to each indivdual computers?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now