Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
Redmond desk4 min

How to Use the OSLicense PowerShell Module to Manage Windows Activation

Use OSLicense PowerShell cmdlets to inspect Windows license status and perform supported activation operations. Check build availability, select the right product, run elevated, and verify results.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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
Windows 11 Pro Upgrade, from Windows 11 Home (Digital Download)
  • 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-OSLicenseInfo with 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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

  1. Confirm support: verify the Windows release and update level on the target against the OSLicense documentation.
  2. Inspect first: run Get-OSLicenseInfo and identify the intended product, using its ActivationID rather than assuming the default selection is the right one.
  3. Open an elevated PowerShell session: Microsoft says to run Invoke-OSLicense elevated.
  4. Select exactly one intended operation: follow the parameter set and requirements in Microsoft’s Invoke-OSLicense reference.
  5. Check the returned object: inspect Success and Operation. A successful operation may include additional operation-specific fields; a caught failure includes Success = $false, ErrorCode, and ErrorMessage.

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.

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.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.