So the other day I was trying to activate someone's copy of windows, since whoever imaged their machine didn't do so, apparently. I could remote into the machine, but could not activate the license because the user didn't have sufficient permissions; and for some reason, when I tried to switch user, it would try to log me in, then just boot me straight off with no message or reason why.
So, my fix was to do a run as different user on a command prompt, and used the slmgr.vbs -ipk LicenseKey and slmgr.vbs -ato commands. It was then I was wondering if I could script those into the tail end of our image deployment so that we can skip that step on post-deployment setup. I tried to do it as just
REMEXEC0=slmgr.vbs -ipk LicenseKey
But it failed with some kind of error about it not being a proper WMI or something.