I am looking for some script wich take mac address of computer with command for example "getmac /NH /FO csv" select just first 19 characters (Its always MAC in my case like this "00-FE-51-CC-B2-C5") and after that take a look in table that contains all MAC addresses with product keys and select right poduct key and activate it.

This script is for computers after sysprep and image (We can not have activation server)

Goal is have this script in first logon on setup so Windows will be always activated after installation with correct key.

For Example:

getmac /NH /FO csv gives me "ED-42-36-CE-B5-B5"

Script takes a look to table like this and select changepk.exe /22222-22222-22222-22222-22222

"00-FE-51-CC-B2-C5" - changepk.exe /11111-11111-11111-11111-11111 (Product key 1)
"ED-42-36-CE-B5-B5" - changepk.exe /22222-22222-22222-22222-22222 (Product key 2)
"42-DE-38-C7-E5-E3" - changepk.exe /33333-33333-33333-33333-33333 (Product key 3)

slmgr.vbs -ato

I will be very thankful if you can make it for me.