Run Windows activation troubleshoot

Does somebody know which pack contains the Windows Activation troubleshoot our how do i get it running? I think i found troubleshoot packs here: C:\Windows\Diagnostics\System\ and with powershell command like this I should get it running:Get-TroubleshootingPack -Path “C:\Windows\Diagnostics\System\pack” | Invoke-TroubleshootingPack”

Problem: even though we have product key and id (shows in setting -> activation) (windows 10 evaluation) it sometimes display error message: “We can’t activate Windows on this device because you don’t have a valid digital license of product key. If you think you do have a valid license or key, select Troubleshoot below. Error code 0xC004F012” and then there is text on wallpaper ““Windows licence is expired”” With login script that runs the troubleshoot, i would get rid of the “Windows licence is expired” and issues related to that.

I have tested that when pressing “Troubleshoot” in settings -> Activation activates windows

If you’re not set on using a Troubleshooting pack, here’s a function to get a machine’s licensure status. The Statuses can be helpful in diagnosing activation issues.

function Get-ActivationStatus {


    [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]

    [string]$DNSHostName = $Env:COMPUTERNAME


process {

    try {

        $wpa = Get-WmiObject SoftwareLicensingProduct -ComputerName $DNSHostName `

            -Filter "ApplicationID = '55c92734-d682-4d71-983e-d6ec3f16059f'" `

            -Property LicenseStatus -ErrorAction Stop


    catch {

        $status = New-Object ComponentModel.Win32Exception ($_.Exception.ErrorCode)

        $wpa = $null    


    $out = New-Object psobject -Property @{

        ComputerName = $DNSHostName;

        Status       = [string]::Empty;


    if ($wpa) {

        :outer foreach ($item in $wpa) {

            switch ($item.LicenseStatus) {

                0 {$out.Status = "Unlicensed"}

                1 {$out.Status = "Licensed"; break outer}

                2 {$out.Status = "Out-Of-Box Grace Period"; break outer}

                3 {$out.Status = "Out-Of-Tolerance Grace Period"; break outer}

                4 {$out.Status = "Non-Genuine Grace Period"; break outer}

                5 {$out.Status = "Notification"; break outer}

                6 {$out.Status = "Extended Grace"; break outer}

                default {$out.Status = "Unknown value"}




    else {$out.Status = $status.Message}




You can feed this via pipeline:
PS C:\Users\nate> 'localhost','localhost' | Get-ActivationStatus

ComputerName Status

localhost Licensed
localhost Licensed

Or, with the -ComputerName parameter, which defaults to the local machine:
PS C:\Users\nate> Get-ActivationStatus

ComputerName Status

DESKTOP Licensed