Link to home
Start Free TrialLog in
Avatar of GSIAdmin
GSIAdmin

asked on

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
Avatar of Brum07
Brum07
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER CERTIFIED SOLUTION
Avatar of Mirtheil
Mirtheil
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of GSIAdmin
GSIAdmin

ASKER

mirtheil,

Can I run this batch on any computer or must it be on the computer I am renaming?
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.
I try above and still no luck.  Anyone else have a solution
What behavior did you see?  Did it not change the name?  Did you reboot the remote machine after running the command?  
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
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?