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=MyComput ername01
00-23-AF-92-6A-0F=MyComput ername02
Eg: mac address = computer name
00-23-AF-92-6F-0F=MyComput
00-23-AF-92-6A-0F=MyComput
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
mirtheil,
Can I run this batch on any computer or must it be on the computer I am renaming?
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.
ASKER
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?
ASKER
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
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
ASKER
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?
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?
https://www.experts-exchange.com/questions/21906188/Script-to-assign-computer-names-based-on-MAC-address.html