Forgive my script code. I'm a total noob, and my last "script" was in dos 6.2 making bootup disks and menus for my PC dos games.
Okay, I got a script to rename a PC with model number + serial number (ie. Optiplex 380 w/ serial number xxxxx = "380-xxxxx") Currently, I have a script to rename the PC, then it adds a registry entry in the RunOnce to run a second script to add the computer to a Domain, it then restarts the PC. After reboots, the RunOnce initiates, and adds the computer, and reboots again.
I'd like to know if it's possible to add the computer to the domain with its NEW name before the 1st reboot, and without the registry hack.
Have you tried doing it? I think it will work if you just do it in one step. I'm fairly certain the wmi name change will be the one used when calling add-computer even though it hasn't officially changed yet:
Microsoft is conducting an online survey to understand your opinion of the Technet Web site. If you choose to participate, the online survey will be presented to you when you leave the Technet Web site.