Free tools Windows power users keep installed
One-click scans. No signup required.
Microsoft’s OSLicense module lets administrators inspect Windows licensing information and perform activation operations from PowerShell. Use Get-OSLicenseInfo to check a license, then use Invoke-OSLicense only when you intend to change licensing state. Availability is build- and update-dependent, so confirm that the target computer supports the cmdlets before planning a script.
What OSLicense does—and where it is available
OSLicense is a Windows PowerShell module for retrieving licensing information and configuring activation. Microsoft documents cmdlets for Windows operating-system licensing, Active Directory-based activation, Key Management Service (KMS), and subscription licensing. The module requires Windows PowerShell 5.1, but having that shell alone does not establish that OSLicense is available on a particular Windows installation. Check the target computer’s release and update level against Microsoft’s OSLicense module reference.
As an Amazon Associate I earn from qualifying purchases.
The current Get-OSLicenseInfo and Get-ADLicenseInfo references specifically list availability in Windows Server vNext Preview Build 29651 and in the Windows 11 2026-09 security update, KB5124008. Those are specific availability statements, not a promise that every Windows 11 or Windows Server system has the module. See Microsoft’s references for Get-OSLicenseInfo and Get-ADLicenseInfo and verify the machine’s installed release and patches.
Recommended Free Tools
Cmdlet families
The module reference lists Get-OSLicenseInfo, Invoke-OSLicense, Set-OSLicenseInfo, Get-ADLicenseInfo, Invoke-ADLicense, Get-KmsLicenseInfo, Invoke-KmsLicense, Set-KmsLicenseInfo, Get-SubscriptionLicenseInfo, and Invoke-SubscriptionLicense. Use the reference for the specific cmdlet to confirm its parameters and supported scenario; the commands are not interchangeable.
#1 Best Overall
- Instantly productive. Simpler, more intuitive UI and effortless navigation. New features like snap layouts help you manage multiple tasks with ease.
- Smarter collaboration. Have effective online meetings. Share content and mute/unmute right from the taskbar (1) Stay focused with intelligent noise cancelling and background blur.(2)
- Reassuringly consistent. Have confidence that your applications will work. Familiar deployment and update tools. Accelerate adoption with expanded deployment policies.
- Powerful security. Safeguard data and access anywhere with hardware-based isolation, encryption, and malware protection built in.
Check whether Windows is activated
For a scriptable check on a supported system, start with Get-OSLicenseInfo. It returns structured licensing data queried through local software licensing CIM classes. Without parameters, it selects the first primary Windows product that has a partial product key and is not an add-on. That default is not a report of every licensing product installed on the computer.
Choose the query scope
Get-OSLicenseInfowith no parameters: inspect the default primary Windows product.Get-OSLicenseInfo -All: query products using application ID and name.Get-OSLicenseInfo -ActivationID <ID>: select a product by its exact activation ID.- Token-related switches: query token-based licenses or certificates; consult the cmdlet reference for the exact switch and its supported use.
Useful returned properties include Name, ActivationID, PartialProductKey, LicenseStatus, LicenseStatusReason, GracePeriodRemaining, and EvaluationEndDate. Review the status and reason fields together, and make sure the query selected the product you meant to inspect. For the full parameter and output details, see Microsoft’s Get-OSLicenseInfo reference.
If you are checking your own PC rather than administering a script, Windows Settings also provides an activation status page. The steps and eligibility can vary with how Windows was obtained; Microsoft explains the digital-license and product-key routes in its Activate Windows guidance.
Perform an activation or licensing operation
Invoke-OSLicense selects an operation through its parameter set. Microsoft describes its effect directly: “Invoke-OSLicense performs one state-changing Windows licensing operation on the local computer.” It can install or remove a product key, install a license file, reinstall a system license, rearm, activate online or offline, activate a token, or remove a token license. If you provide no operation selector, the cmdlet returns no output and does not act.
Safe execution sequence
- Confirm support: verify the Windows release and update level on the target against the OSLicense documentation.
- Inspect first: run
Get-OSLicenseInfoand identify the intended product, using itsActivationIDrather than assuming the default selection is the right one. - Open an elevated PowerShell session: Microsoft says to run
Invoke-OSLicenseelevated. - Select exactly one intended operation: follow the parameter set and requirements in Microsoft’s Invoke-OSLicense reference.
- Check the returned object: inspect
SuccessandOperation. A successful operation may include additional operation-specific fields; a caught failure includesSuccess = $false,ErrorCode, andErrorMessage.
For online activation and product-key removal, omitting ActivationID selects the first primary Windows product with a partial key that is not an add-on. If a particular product is intended, pass its verified activation ID. Offline activation has separate installation-ID and ConfirmationID requirements; use the reference’s exact syntax rather than adapting an online command. A successful rearm result indicates that a restart is required.
Rank #2
- Fresh USB Install With Key code Included
- 24/7 Tech Support from expert Technician
- Top product with Great Reviews
Online activation and legacy scripts
Microsoft’s Windows IT Pro blog maps the legacy slmgr.vbs /ato operation to Invoke-OSLicense -ActivateOnline as a high-level migration correspondence. Treat that mapping as a starting point only: the cmdlet reference governs syntax, parameter behavior, elevation, and result handling. See the Windows IT Pro migration article.
Protect keys and interpret activation correctly
Product keys and token PINs are sensitive. Microsoft warns that they can be exposed through command history, transcripts, logs, or other disclosures. Avoid placing real keys in shared examples, saved scripts, or logs, and take care when capturing PowerShell output.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →A successful activation operation reports an activation result; it does not prove that a Windows copy is genuine or that the user is entitled to a particular license. Microsoft explains that activation associates a product key or digital entitlement with a device’s hardware configuration, and that activation itself does not evaluate authenticity. For major hardware changes, linking a digital license to a Microsoft account can enable the Activation troubleshooter to help reactivate Windows, subject to the applicable entitlement and edition.
Choose the right activation route
| Situation | Practical route | Important distinction |
|---|---|---|
| Checking a supported computer from a script | Get-OSLicenseInfo |
Inspection only; confirm which product the query selected. |
| Changing licensing state on a supported computer | Elevated Invoke-OSLicense with an explicit operation |
State-changing local operation; validate the target and inspect the result object. |
| Interactive activation or troubleshooting | Windows Settings and Microsoft Support guidance | Eligibility depends on how Windows was obtained and the device’s entitlement. |
| Organization-managed activation | Relevant AD, KMS, or subscription cmdlets | Use the cmdlet family and parameters appropriate to the organization’s configured licensing method. |
| Offline activation | Invoke-OSLicense offline operation |
Requires the operation’s installation ID and ConfirmationID inputs. |
For licensing methods beyond local Windows activation, start from the OSLicense module reference and open the specific cmdlet documentation. The appropriate route depends on the Windows edition, entitlement, organizational configuration, and supported build.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




