Recently I had to troubleshoot a problem with our Sysprepped Windows XP SP3 clients getting the following error:
"The remote computer disconnected the session because of an error in the licensing protocol. Please try connecting to the remote computer again or contact your server administrator. "
On all the XP SP3 images, the HKLM\SOFTWARE\Microsoft\MSLicensing\HardwareID\ClientHWID key was identical on all machines. The Terminal server uses this key to distinguish each device. This causes the Terminal Server License server to think that every machine is the same device, hence the warning message above. Our Terminal Server License server also would not properly consume licenses for these clients. This problem did not appear until we started deploying SP3 sysprep images.
So what happened in SP3?
Apparently there is a bug in the way sysprep in SP3 check for the existence of the HKLM\SOFTWARE\Microsoft\MSLicensing\HardwareID\ClientHWID key. Instead of deleting it during the sysprep, it remains and gets cloned to all machines giving us this problem. (This bug was confirmed during a support call to Microsoft)
So how do we fix this?
Delete the MSLicensing key. The next time you connect to a Terminal server, it will recreate the MSLicensing key and thus a new ClientHWID. You can do this on the master image before sysprep as well as previously deployed images. One downside of this is that users require at least Power User access to be able to re-create this key. Alternately you could logon as an administrator and connect to a terminal server to pre-create the key for them.
If you have many machines to fix like me, I did the following remotely via a PSEXEC script.
Reg Delete HKLM\SOFTWARE\Microsoft\MSLicensing /f
Regsvr32 /u mstscax.dll
Regsvr32 /s mstscax.dll
(The registration of the mstscax.dll is the one responsible for creating the MSLicensing Key.)
I also added the re-registration of the mstscax.dll to a runonce in my sysprep and the problem is gone.