Wednesday, August 22, 2012

My First Windows 8 Bug–PowerShell to the Rescue

Unless you are living in a cave, high in the Himalaya, you must have heard that Windows 8 made it to release. After a long wait, it was finally made available on TechNet – and I downloaded it as quickly as I could. My first action for any new OS build these days is to fire it up in a VM and see what’s there, which I duly did. The Installation process, which we first saw with Vista, is quick and my VM was ready in a flash. Since this is a VM I plan to keep and use, I went to activate it.

To activate Windows 8, you bring up the PC Settings:

image

Clicking Activate brings  up this message:

image

 

Bringing up the Action Center/Windows Activation, and I get this error screen:

 

image

Notice the red squared items. It shows a partial key (no idea where it got that from as I never entered one!). And it shows an Activation Error – DNS name does not exist. WHAT?  On the assumption that this error message was vaguely right, I spent some time trying to see what DNS issues there might be – needless to say I found nothing obvious. I moved the VM around, changed VM networking, etc. but to no avail.

I then spent some more time trying to work out how to add the correct key. I assumed that a) the error was nothing to do with DNS, and b) the real error was invalid key. But there seems to be no way, in this ‘fast/fluid’ dialog box, to add a key. I never was able to work out how to do that from the GUI, and the built in help text referred to dialog boxes that did not appear to exist.

Just as I was about to give up and turn to TechNet forums for help, I remembered a trick I used to use in some MOC Classroom setups where I continually had licensing problems. Naturally, these days, the solutions is almost always PowerShell based or at least invoked from PowerShell!

So after firing up PowerShell, in an elevated prompt, I ran the SLMGR.VBS utility, which brings up several pages of help text. On the first page I saw this (NB: if you click OK on the first page, the script brings another page of help text, and another  – there are several!).

Here’s what I see on the first page:

 

image

 

So,in the elevated PowerShell prompt, I just entered two quick commands as shown below. Of course, my key is not really FFFFF-EEEEE-etc., but you get the idea.

image

After typing 'slmgr –ipk <key>’, I get the following dialog box (which shows the real key I entered – but I’ve blacked that out for the purposes of this blog post):

image

After entering a key, successfully, I just entered ‘slmgr /ato’ to bring up this (also masking out my real key):

image

 

So once again, PowerShell to the rescue of the ‘fast/fluid/fail’ that seems, to me, to sum up Windows 8.  Thinking about it, this is the sort of problem you see in  a product that was not well enough tested (aka rushed out before it’s ready). Why wasn’t this tested fully and this bug found and fixed? And a second question – why do I need to use VBScript? Has the Windows activation team not heard of PowerShell?

I suppose all’s well that ends well – my VM is activated and I know how to do it again when I need to. But it leaves me with an unpleasant feeling – if something so fundamental as activation is broken, what else is? I guess we’ll find out soon enough.

[Later]

I wrote the outline of this blog post last night and did most of the screen shots and posted it this morning. After doing so, I see from my mail box that I am not the only person to have found this bug (and solved it). Having said that, I think I’m the only person who used PowerShell!  So apologies if you beat me to it!

4 comments:

aleksandar said...

Thomas, how did exactly PowerShell help you to resolve this problem? Running a VBScript file from a PowerShell console? ;)

Btw, a proper title like "How to activate Windows 8 Enterprise without a KMS server" would be of a better help to the community.

Forsmark said...

Hi,

Because you have not entered a product key Windows will try to activate using the build-in key used for KMS activation.
So Windows will look in your DNS for a SRV record called _VLMCS._tcp that should point to yoru KMS server. When you don't have a KMS server there will be no KMS DNS record and therefore Windows will complain that it cannot find the DNS entry.
So it is not a bug. It is a feature. :-D

Forsmark said...

Hi,

Because you have not entered a product key Windows will try to activate using the build-in key used for KMS activation.
So Windows will look in your DNS for a SRV record called _VLMCS._tcp that should point to yoru KMS server. When you don't have a KMS server there will be no KMS DNS record and therefore Windows will complain that it cannot find the DNS entry.
So it is not a bug. It is a feature. :-D

Patch said...

Really? You are claiming this as a fix in powershell?!

Given that an elevated CMD prompt would have done the trick in exactly the same way I think you are stretching your definition there a bit :)

When you mentioned the .VBS I assumed you were about to go into the depths of recreating it in PS. That would have been impressive.