Checking Windows Activation Status With the PDQ Inventory Powershell Scanner

Purpose:

You need to verify the Windows activation status on the computers in your network. 

Resolution: 

Use the PDQ Inventory Powershell Scanner to gather the data and Dynamic Collections to organize which computers are activated and which computers are not. 

 

We're going to start off by creating a new Powershell Scanner, with a script utilizing the Get-CimInstance cmdlet to determine the activation status of your Windows computers. 

Navigate to Computer > Scan Profiles > New > Name your new Scan Profile "Windows Activation Status".

01_-_Creating_New_Scan_Profile.png

Select Add > Powershell.

02_-_Selecting_the_Powershell_Scanner.png

Name the Powershell Scanner "Windows Activation Status" > Select the "Script" radio bubble.

03_-_Configuring_the_Powershell_Scanner.png

Copy the script below into the text box, and select OK.

Get-CimInstance SoftwareLicensingProduct -Filter "Name like 'Windows%'" | where { $_.PartialProductKey } | select Description, LicenseStatus

Once you've added the Powershell Scanner to your Scan Profile, select OK to save the new Scan Profile.

04_-_Completed_Scan_Profile.png

Next, we want to confirm that our new Powershell Scanner is working. Pick a computer to scan > Right click > Scan Computers > Windows Activation Status.

05_-_Scanning_a_Computer.png

Once the Scan is complete, double click the computer to open the computer properties > Select the Powershell tab on the left-hand pane > Select the dropdown > Select the "PowerShell (Windows Activation Status)" scanner to get the latest results.

06_-_Selecting_Scan_Results.png

The "LicenseStatus" Column will have a number, 0 - 6, that tells us the Windows activation status. You will find what each of those numbers mean below, but the most important thing to know is that "1" means Windows is activated and any other number means it is not.

00_-_Windows_Activation_Status_Codes.png
Now that we have created our Windows Activation Status Scan Profile using the Powershell Scanner, and confirmed that it is working, we need to create two Dynamic Collections. One Collection for computers with an activated copy of Windows and one Collection for computers without an activated copy of Windows. 07_-_License_Status.png

For the "Windows Activated" Collection, Use the "All" Group Filter, with the Value Filters set to: PowerShell (Windows Activation Status) > LicenseStatus > Equals > 1.

08_-_Windows_Activated_Dynamic_Collection.png

For the "Windows Not Activated" Collection, Use the "All" Group Filter, with the Value Filters set to: PowerShell (Windows Activation Status) > LicenseStatus > NotEqual > 1.

09_-_Windows_Not_Activated_Dynamic_Collection.png

Once you've got your new Scan Profile configured with the Powershell Scanner and your Dynamic Collections created go ahead and scan the computer or Collections that you wish to find out the Windows activation status, and you will see your Collections populate. 

Still have a question or want to share what you have learned? Visit our Community to get help and collaborate with others.