If you are setting everything else to DHCP, why not set option 015 in the DHCP to serve out the DNS Domain Name? We have done it for thousands of computers in our AD migration.

Anyway, if you insist on hacking into the reg...

$rc = WriteValue('\\'+$pc+'\HKLM...
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.