How to Check Windows and Office Activation Status Using Microsoft Activation Scripts
The Microsoft Activation Scripts repository provides a read-only diagnostic tool that queries the Windows Software Protection Platform (SPP) and Office Software Protection Platform (OSPP) to display licensing states, grace periods, and KMS subscription details without modifying system files.
The Microsoft Activation Scripts (MAS) repository offers a robust, open-source utility for verifying software licensing states. Whether you need to audit enterprise deployments or troubleshoot activation errors, the Check_Activation_Status.cmd script provides detailed visibility into both Windows and Microsoft Office activation metadata by directly interfacing with native Software Protection Platform APIs.
How the Activation Status Check Works
The activation status utility follows a 13-step diagnostic pipeline implemented in MAS/Separate-Files-Version/Check_Activation_Status.cmd. The script performs read-only queries against Microsoft's undocumented SPP interfaces to retrieve licensing data.
Hybrid Batch-PowerShell Architecture
The tool uses a hybrid design to ensure compatibility across all Windows environments. The outer batch wrapper sets a clean PATH, forces FullLanguage mode for PowerShell, and defines helper variables (_err, _psc) before extracting the embedded PowerShell script located after the :sppmgr: label. This approach guarantees execution even on systems with restricted PowerShell policies, while delegating heavy lifting to a pure PowerShell block for API interaction.
Dynamic P/Invoke to Native SPP APIs
Instead of relying on external binaries, the script dynamically creates a .NET type at runtime that maps native functions from sppc.dll, slc.dll (Windows), and osppc.dll (Office). The InitializePInvoke function establishes these mappings for undocumented APIs including SLGetInfoSLID, SLIsWindowsGenuineLocal, and various SLGet* methods. This grants direct access to activation IDs (SLIDs), license status flags, and genuine state verification without shipping compiled dependencies.
Product-Agnostic Processing Pipeline
The script treats Windows and Office uniformly through a generic discovery and parsing workflow:
- Service Validation – Verifies that SPP/KMS services are running and required DLLs are present
- SLID Retrieval – Calls
SlGetInfoSLIDfor Windows GUIDs ($winApp) and Office GUIDs ($o15App,$o14App) to enumerate activation IDs - Status Parsing – The
ParseListfunction iterates over each SLID, invokingGetResultto gather licensing fields including product name, license status, and grace period expiration - Client Licensing Checks – For Windows 8+,
ClcRunexposes kernel expiration and partial product keys; for Windows 10+,ClicRunreveals subscription status and digital license information viaEditionUpgradeManagerObj.dll - Office-Specific Diagnostics –
CheckOhookdetects Ohook permanent activation, whilevNextDiagRuninspects Office 365 "vNext" licensing registry keys and shared-computer-licensing status on Windows 10/11
Running the Activation Status Checker
Basic Usage
Navigate to the separate files version directory and execute the batch wrapper to display both Windows and Office activation states:
cd MAS\Separate-Files-Version
Check_Activation_Status.cmd
The output displays structured sections showing product names, license status, evaluation end dates, and partial product keys for all discovered Microsoft software.
Advanced Diagnostic Flags
The script accepts several optional parameters to modify output behavior and detail level:
-All– Disables the "press any key to exit" prompt and expands the console buffer for full output capture-Dlv– Enables detailed re-arm counts and trusted-time information display-IID– Resolves and displays the offline installation ID for each product key-Pass– Suppresses the initial clear-screen command, useful when piping output to other tools
To generate a comprehensive activation report with all hidden fields visible:
Check_Activation_Status.cmd -All -Dlv -IID
This outputs additional metadata including KMS server details, digital license flags, subscription information, and vNext license file enumerations.
Capturing Output for Scripting
For automated compliance checks, redirect the diagnostic output to a file for later parsing:
Check_Activation_Status.cmd -All > activation_report.txt
type activation_report.txt
You can then programmatically verify genuine licensing status using PowerShell's Select-String or similar text processing tools:
Select-String -Path activation_report.txt -Pattern "License Status: Licensed"
Filtering Specific Products
While the script always enumerates all products, you can pipe output through findstr to isolate specific entries:
Check_Activation_Status.cmd | findstr /i "Windows"
Understanding the Diagnostic Output
The tool queries multiple data sources to construct a complete licensing profile.
Windows Activation Fields
When processing Windows SLIDs, GetResult extracts:
- License Status – Indicates Licensed, Grace Period, or Notification mode
- Evaluation End Date – Timestamp for volume license expiration
- Partial Product Key – Last five characters of the installed key for inventory matching
- Digital License – Boolean flag indicating Windows 10/11 digital entitlement status
Office Activation Fields
For Office products, the script mirrors the Windows flow while adding:
- Ohook Detection – Identifies permanent activation bypasses via
CheckOhook - vNext Licensing – On Windows 10/11 systems (
$NT7), inspects modern Office 365 subscription registry keys and enumerates license files for shared-computer scenarios
KMS and Subscription Diagnostics
Inside GetResult, conditional logic calls specialized detection functions when KMS or subscription licensing is identified:
DetectKmsClient– Displays KMS client configuration and remaining grace periodDetectKmsHost– Reveals KMS server details and re-arm countsDetectSubscription– Exposes Office 365 subscription metadata and expiration dates
Summary
- The Microsoft Activation Scripts repository provides a read-only diagnostic utility at
MAS/Separate-Files-Version/Check_Activation_Status.cmdthat safely queries activation status without system modifications. - The tool uses dynamic P/Invoke to call native SPP APIs (
sppc.dll,osppc.dll) directly from PowerShell, eliminating external binary dependencies. - Execution requires only the batch wrapper, which handles environment preparation and PowerShell execution policy bypass automatically.
- Four optional flags control output detail:
-All(buffer expansion),-Dlv(detailed licensing view),-IID(installation ID), and-Pass(no clear-screen). - The script discovers Windows and Office SLIDs (activation IDs) and processes them through a uniform
ParseList→GetResultpipeline to display license status, grace periods, partial product keys, and KMS subscription data.
Frequently Asked Questions
How does the script access activation information without modifying Windows?
The tool strictly performs read-only queries against the Software Protection Platform using officially exposed (though undocumented) COM APIs. By dynamically defining P/Invoke signatures for slc.dll and sppc.dll functions like SLGetInfoSLID and SLIsWindowsGenuineLocal, the script retrieves licensing data structures without altering registry keys, installing certificates, or modifying token stores.
Can I check activation status on systems where PowerShell is disabled?
Yes. The outer Check_Activation_Status.cmd batch file is specifically designed to function as the entry point on restricted systems. It extracts and executes its embedded PowerShell block while forcing FullLanguage mode, bypassing common execution policy restrictions. However, PowerShell must be present on the system—it cannot function on Windows editions where PowerShell components are completely removed.
What is the difference between the Separate-Files-Version and All-In-One-Version for checking status?
MAS/Separate-Files-Version/Check_Activation_Status.cmd contains only the diagnostic logic and launches immediately. MAS/All-In-One-Version-KL/MAS_AIO.cmd bundles the same activation-status functions alongside activator tools (KMS, TSforge) into a single file with a menu interface. The underlying GetResult, ParseList, and DetectKmsClient functions are identical in both versions; only the packaging and user interaction layer differ.
How do I interpret "Grace Period" versus "Licensed" in the output?
Licensed indicates the system has validated permanent activation through retail keys, volume license KMS with sufficient count, or digital entitlement. Grace Period indicates the installation is in an evaluation or out-of-tolerance state—KMS clients show this when they cannot reach a KMS server, while retail installations display this after hardware changes trigger reactivation requirements. The script displays the exact Evaluation End Date and remaining minutes when the -Dlv flag is used.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →