-
Notifications
You must be signed in to change notification settings - Fork 6
windows_product_key_to_superops.ps1
Corey Watson edited this page Dec 1, 2025
·
1 revision
Retrieves the Windows product key from the local machine's registry and sends it to SuperOps custom field.
Retrieves the Windows product key from the local machine's registry by decoding the DigitalProductId value and sends it to a SuperOps custom field for asset management and license tracking. Designed for unattended execution in RMM environments to automatically populate license information.
Retrieves the Windows product key from the local machine's registry by decoding the DigitalProductId value and sends it to a SuperOps custom field for asset management and license tracking. Designed for unattended execution in RMM environments to automatically populate license information.
- PowerShell 5.1 or later
- SuperOps RMM agent installed and module available
- $SuperOpsModule variable must be defined by SuperOps agent
- Registry access to read Windows product information
- CustomFieldName : 'Windows Product Key' (The name of the SuperOps custom field to populate with the product key.)
- RegistryKeyPath : 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' (Registry path where DigitalProductId is stored.)
- Hardcoded values (defined within the script body)
- Windows Registry (HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion)
- SuperOps API (via Send-CustomField)
- Error
- Decodes DigitalProductId using standard Windows key algorithm
- Sends decoded product key to SuperOps custom field
- Uses SuperOps module's Send-CustomField function
- Product key format: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
- Script reads DigitalProductId from registry
- Converts binary product ID to readable product key format
- Sends product key to specified SuperOps custom field
- If product key cannot be retrieved, reports error and exits
- Product key is sent to SuperOps (no secrets in local logs)
- Registry read is non-destructive
- Product key is considered sensitive licensing data
- 0 = Success
- 1 = Failure
[ INPUT VALIDATION ]
--------------------------------------------------------------
CustomFieldName : Windows Product Key
RegistryKeyPath : HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion
[ RETRIEVE PRODUCT KEY ]
--------------------------------------------------------------
Reading DigitalProductId from registry...
Decoding product key...
Product Key : XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
[ SEND TO SUPEROPS ]
--------------------------------------------------------------
Sending to custom field: Windows Product Key
SuperOps update successful
[ FINAL STATUS ]
--------------------------------------------------------------
Product key retrieved and sent to SuperOps successfully.
[ SCRIPT COMPLETED ]
--------------------------------------------------------------
- 2025-10-31 v1.0.0 - Initial Style A compliant release with Windows product key retrieval and SuperOps integration.
- View Script Source
- Scripts - Back to script index