Change computer name base on MAC address

(imported topic written by zeedwolf91)

Hi there,

Anyone has done this before?

I have a list of MAC Address and I want to use this MAC Address to change computer name of that machine.

Is it possible? Any help?

(imported comment written by jessewk)

See this thread:

How many machines are you trying to change? If it’s more than a few there are several ways you might go about automating the process to get it done quickly.

(imported comment written by zeedwolf91)

Thanks… I have read that thread…

I try to change more that 200 machine

Is there any other way to do it? Any help?

(imported comment written by jessewk)

Couple of ideas…

  1. If you can construct the name based on some criteria that is already present on the machine you can do this easily using relevance substitution. You would take the task from the above mentioned post and replace the 2 lines that start:

action parameter query …
waithidden …

with one line:

waithidden cmd.exe /C __download\compname /c {insert relevance statement here}

Then just target your action at the list of machine you need to change.

  1. You could write a script to generate an action for each machine. The script would be very simple. Pseudo code:

    newnames = [ name1, … , name n ] oldnames = [ name1, … , name n ]

    for (i = 0, i < newnames.length, i++) template = read file changename_template.bes template.replace( $NEWNAME , newnames+ ) template.replace( $OLDNAME , oldnames+ ) write template to file
    "changename_" + newnames+ +

The file changename_template.bes is the same as the .bes file from the post above, but with 3 lines changed.

name of operating system as lowercase contains "win"
computer name = “$OLDNAME”

delete line:
action parameter query …

waithidden cmd.exe /C __download\compname /c {parameter “newcompname” of action}
waithidden cmd.exe /C __download\compname /c $NEWNAME

  1. Option number 2 isn’t ideal because it creates an action for each computer. Instead, you could do basically the same thing, but craft a single action script with 200 if statements: if $OLDNAME then waithidden cmd.exe … $NEWNAME

Of the 3 options, number 1 is definitely best and easiest. Number 3 is better than number 2, but maybe a tiny bit more complicated

(imported comment written by zeedwolf91)

Thanks for the great idea. I’ll try that.

Thanks again