Microsoft OS License details on Windows devices
  • 02 Feb 2024
  • 1 Minute to read
  • PDF

Microsoft OS License details on Windows devices

  • PDF

Article Summary

Operating system licenses are contractual agreements permitting users to legally utilize and access the software. Admins play a crucial role in ensuring that the Microsoft OS licenses align with the organization's terms, including verifying the accurate usage count and validity. However, manually inspecting license details on each device can be a laborious task.

The following PowerShell script helps the IT Admins to remotely get the OS license details from their managed Windows devices.

  1. Create a file on your desktop, for example, os_license_info.ps1 and open it in a text editor like notepad++

  2. Copy the contents below to the file or click here to download the file.

    $lic = Get-WmiObject -Class SoftwareLicensingProduct | Where-Object {$_.PartialProductKey -ne $null} 
    $id  = (Get-WmiObject -query 'select * from SoftwareLicensingService').OA3xOriginalProductKey
    echo "License Name: $($lic.Name)" 
    echo "Descriptions: $($lic.Description)" 
    echo "Application ID: $($lic.ApplicationId)" 
    echo "Product Key Channel: $($lic.ProductKeyChannel)" 
    echo "Use License URL: $($lic.UseLicenseURL)" 
    echo "Validation URL: $($lic.ValidationURL)" 
    echo "PartialProductKey: $($lic.PartialProductKey)" 
    echo "ProductKey ID: $($lic.ProductKeyID)" 
    echo "License Status: $($lic.LicenseStatus)" 
    echo "Product Key: $id"  
  3. You will be able to see the details in the Output tab in the View Status report on the Scalefusion dashboard.

  4. Follow our guide to upload & publish the PowerShell script using Scalefusion Dashboard.

Please note that to use the PowerShell scripts, the Scalefusion MDM Agent Application must be installed on the device(s). Please follow our guide to publish and install the Scalefusion MDM Agent Application.

Notes:

  1. The scripts and their contents are sourced from various albeit authenticated Microsoft sources and forums.

  2. Please validate the scripts on a test machine before deploying them on all your managed devices.

  3. Scalefusion has tested these scripts, however, Scalefusion will not be responsible for any loss of data or system malfunction that may arise due to the incorrect usage of these scripts.


Was this article helpful?