In many organizations, some Windows devices remain non-activated due to imaging issues, network problems, or incorrect licensing configuration. These non-activated systems may cause compliance and functionality issues.
Using Microsoft SCCM (Configuration Manager), administrators can easily identify non-activated devices and automatically activate them using a script deployment.
In this guide, we will cover:
- How to identify non-activated Windows devices
- How to create an SCCM device collection
- How to deploy a PowerShell activation script
- How to verify the activation status
Step 1: Identify Non-Activated Windows Devices
To identify devices that are not activated, we will create a WQL query in SCCM that checks the Windows licensing status.
The query uses the SoftwareLicensingProduct class to detect systems where the license status is not activated.
select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System WHERE SMS_R_System.ResourceID NOT IN ( SELECT slp.ResourceID FROM SMS_G_System_SOFTWARE_LICENSING_PRODUCT slp WHERE slp.ApplicationID = "55c92734-d682-4d71-983e-d6ec3f16059f" AND slp.LicenseStatus = 1 )
Create a Device Collection
After identifying the query, the next step is to create a device collection in SCCM that will dynamically contain all non-activated systems.
Open SCCM Console → Assets and Compliance → Device Collections → Click Create Device Collection

Configure Collection
Provide details:
- Name: Non-Activated Devices
- Limiting Collection: All Systems
Click Next.

Add Query Rule
Next, we create a query rule that will automatically populate the collection with non-activated systems.
Steps
- Click “Add Rule.”
- Select Query Rule

Name: Non-Activated Devices
Click “Edit Query Statement.”

Select Criteria and click Show Query Language


Paste the WQL query provided in Step 1.
Click OK → Next → Close



Now SCCM will automatically list all devices with non-activated Windows.

Step 2: Create Windows Activation Script
To activate Windows automatically, we will create a PowerShell script that installs the product key and activates Windows.
# PowerShell Script
$Key = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"
$Windows = Get-CimInstance SoftwareLicensingProduct |
Where-Object {
$_.ApplicationID -eq "55c92734-d682-4d71-983e-d6ec3f16059f" -and
$_.PartialProductKey
}
if ($Windows -and $Windows.LicenseStatus -ne 1) {
cscript.exe //B "$env:SystemRoot\System32\slmgr.vbs" /ipk $Key
cscript.exe //B "$env:SystemRoot\System32\slmgr.vbs" /ato
}
This script:
- Checks Windows activation status
- Installs the product key
- Activates Windows automatically
Create a script in SCCM
Now we will add the script inside SCCM.
Open SCCM Console → Software Library → Scripts → Click “Create Script.”
| Field | Value |
|---|---|
| Script Name | Windows Activation Script |
| Script Type | PowerShell |
Paste the PowerShell script. Click Next → Close




Script Approval
In SCCM, scripts must be approved by another administrator before deployment for security reasons.
Log in with another SCCM admin account. Navigate to Software Library → Scripts → Right-click the script -> Select Approve/Deny

Click Next.

Click Approve and Next.

Click Next.

Click Close.


Deploy Script to Collection
Once approved, we can run the script on the non-activated devices collection.
Go to Assets and Compliance → Device Collections → Select Non-Activated Devices → Right-click → Run Script

Select the Windows Activation Script

Click Next → Next → Close



The script will execute on all devices in the collection.
Monitor Script Execution
To verify the activation process, SCCM provides a script execution monitoring dashboard.
Navigate to: Monitoring → Script Status
Here you can see:
- Execution status
- Success or failure
- Output messages
Successful activation will show Output = activated.
Conclusion
Using SCCM, administrators can easily identify and activate non-activated Windows devices automatically. This method helps maintain licensing compliance and ensures all systems are properly activated without manual intervention.
By combining SCCM collections, WQL queries, and PowerShell scripts, organizations can streamline Windows activation across large environments.
In this article, we learned how to identify non-activated Windows devices using SCCM by creating a device collection based on a WQL query. We also demonstrated how to deploy a PowerShell activation script to automatically activate Windows on those devices and monitor the execution results through the SCCM console. This method helps administrators maintain proper Windows licensing compliance across the organization while reducing manual effort.
If you have not read our previous guide, we recommend checking our earlier article where we explained how to deploy the Microsoft Office package step-by-step using SCCM.
In the next article of this SCCM series, we will explore the Software Update Compliance Report. This report provides valuable insights into patch management by showing which machines are fully patched, which systems are missing updates, and the overall patch compliance percentage across your environment. These reports are widely used for security audits, compliance tracking, and monitoring the overall health of enterprise systems.