Forum Discussion
Windows Server vNext cannot be activated
Error Code 0xC004F012 when trying to activate WS vNext Datacenter with Key 2KNJJ-33Y9H-2GXGX-KMQWH-G6H67.
vbscript is removed, implying the future removal of this component from the OS.
It appears that Windows Activation relies on vbscript.
I would wish for a native PowerShell support / module instead of vbscript.
Is this something that is on the roadmap?
Hi Karl, thanks for reporting this.
Can you please try running the following in elevated PowerShell? Let me know if you encounter the same (or a different) error.
$key = '2KNJJ-33Y9H-2GXGX-KMQWH-G6H67' $sls = Get-CimInstance -ClassName 'SoftwareLicensingService' $arg = @{ 'ProductKey' = $key } Invoke-CimMethod -InputObject $sls -MethodName 'InstallProductKey' -Arguments $arg $slp = Get-CimInstance -ClassName 'SoftwareLicensingProduct' -Filter 'PartialProductKey <> null and ApplicationId = ''55c92734-d682-4d71-983e-d6ec3f16059f''' Invoke-CimMethod -InputObject $slp -MethodName 'Activate' $sls = Get-CimInstance -ClassName 'SoftwareLicensingService' Invoke-CimMethod -InputObject $sls -MethodName 'RefreshLicenseStatus'
3 Replies
- Artem Pronichkin
Microsoft
Hi Karl, thanks for reporting this.
Can you please try running the following in elevated PowerShell? Let me know if you encounter the same (or a different) error.
$key = '2KNJJ-33Y9H-2GXGX-KMQWH-G6H67' $sls = Get-CimInstance -ClassName 'SoftwareLicensingService' $arg = @{ 'ProductKey' = $key } Invoke-CimMethod -InputObject $sls -MethodName 'InstallProductKey' -Arguments $arg $slp = Get-CimInstance -ClassName 'SoftwareLicensingProduct' -Filter 'PartialProductKey <> null and ApplicationId = ''55c92734-d682-4d71-983e-d6ec3f16059f''' Invoke-CimMethod -InputObject $slp -MethodName 'Activate' $sls = Get-CimInstance -ClassName 'SoftwareLicensingService' Invoke-CimMethod -InputObject $sls -MethodName 'RefreshLicenseStatus'Hi Artem Pronichkin​ I have tested b29595 and b29602. This time in a Hyper-V VM for easier repro.
Behaviour is different to what I earlier reported here based on a bare-metal HW installation.
Testing Settings app once again
Interestingly enough both VMs activated trought Settings app as expected, while VBscript FOD has been removed and VM restarted beforehand.
results:
b29595 - works
b29602 - worksexecuting slmgr returns this as expected.
--------------------------- Windows Script Host --------------------------- Can't find script engine "VBScript" for script "C:\WINDOWS\system32\slmgr.vbs". --------------------------- OK ---------------------------
Testing your PowerShell approach:
PS 5.1 b29595 - works
PS 5.1 b29602 - works
PS 7.6.2 b29595 - works
PS 7.6.2 b29602 - works
I did not expect that VMs would activate using settings app. The mentioned key, is not an AVMA key here, I assume.Thank you for your guidance!
- Artem Pronichkin
Microsoft
so, it was previously failing for you on a bare-metal installation, but exactly the same steps (and same build, and same product key) worked in VMs? To clarify, the failing attempt was also via Settings?
it is totally expected that activation should succeed via Settings app, as it does not depend on VBScript. What does require VBScript is slmgr.vbs, and for that we have a few alternatives coming. (One of which is the raw PowerShell commands I provided.)
but of course, it's not expected to fail with 0xC004F012 error code, so please let me know if you encounter it again or know a reliable way to reproduce this problem. Thank you as always!