0% found this document useful (0 votes)
22 views2 pages

Retrieve Windows 10 Product Key

Uploaded by

Karri Amarnath
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views2 pages

Retrieve Windows 10 Product Key

Uploaded by

Karri Amarnath
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1. Power shell – script run.

# Get Laptop Serial Number

$SerialNumber = (Get-WmiObject Win32_BIOS).SerialNumber

# Get MAC Address

$MacAddresses = Get-WmiObject Win32_NetworkAdapterConfiguration | Where-Object


{ $_.IPEnabled -eq $true } | Select-Object MACAddress

# Get Windows OS Product Key

$DigitalProductID = (Get-WmiObject -Query 'SELECT * FROM


SoftwareLicensingService').OA3xOriginalProductKey

# Check Windows License Status

$WindowsLicenseStatus = (slmgr /dlv) | Out-String

# Get MS Office Product Key (if installed)

Function Get-OfficeKey {

$OfficePaths = @(

"HKLM:\SOFTWARE\Microsoft\Office\16.0\Registration",

"HKLM:\SOFTWARE\Microsoft\Office\15.0\Registration",

"HKLM:\SOFTWARE\Microsoft\Office\14.0\Registration"

foreach ($Path in $OfficePaths) {

if (Test-Path $Path) {

$OfficeKey = Get-ItemProperty -Path "$Path\{*}" -Name "DigitalProductID" -ErrorAction


SilentlyContinue

if ($OfficeKey -ne $null) {

return "Office Key Found (Partial): $($[Link] | Out-String)"

}
return "Office Key Not Found"

$OfficeKey = Get-OfficeKey

# Output Results

Write-Host "Laptop Serial Number: $SerialNumber" -ForegroundColor Green

Write-Host "MAC Address(es):" -ForegroundColor Green

$MacAddresses | ForEach-Object { Write-Host $_.MACAddress }

Write-Host "Windows Product Key: $DigitalProductID" -ForegroundColor Green

Write-Host "Windows License Status: $WindowsLicenseStatus" -ForegroundColor Green

Write-Host "MS Office Key: $OfficeKey" -ForegroundColor Green

# Verify if the MS Office key is genuine

if ($OfficeKey -match "Office Key Found") {

Write-Host "Checking MS Office Key Genuineness..." -ForegroundColor Yellow

Start-Process -NoNewWindow -FilePath "[Link]" -ArgumentList ""C:\Program Files\Microsoft


Office\Office16\[Link]" /dstatus"

} else {

Write-Host "No MS Office Key Found. Office may not be installed." -ForegroundColor Red

2. Power shell –

ipconfig /all

3. Cmd Prompt – MS Office Validation –

cscript "%ProgramFiles%\Microsoft Office\Office16\[Link]" /dstatus

4. MS OS Validation

Power shell

slmgr/dli

Common questions

Powered by AI

PowerShell facilitates the validation of installed software like MS Office through scripts that check for registry entries or run verification commands like cscript.exe with specific arguments to verify licensing status. Practical impacts include ensuring software integrity and compliance with licensing terms, preventing the use of pirated software, and protecting the organization from potential legal and financial repercussions associated with license violations .

To obtain a MAC address using PowerShell, you can use Get-WmiObject Win32_NetworkAdapterConfiguration, filtering results with Where-Object { $_.IPEnabled -eq $true } to select network adapters that are currently enabled. The command Select-Object MACAddress retrieves the MAC addresses. This process is significant as MAC addresses are crucial for network configuration, security, and troubleshooting, providing a unique identifier for network interfaces .

Verifying the genuineness of an MS Office key via PowerShell commands like the Start-Process with cscript.exe arguments checks the installed Office version against active licenses. This ensures compliance and prevents piracy, which are beneficial for legal and operational reasons. Challenges include the complexities of scripting nuanced checks for various MS Office versions and configurations, and potential issues if the Office installation paths or registry entries differ from expected defaults .

Scripts can significantly streamline the collection of hardware and software inventory data in large organizations by automating the retrieval of serial numbers, MAC addresses, and software product keys. This automation reduces manual errors, yields consistent datasets, and saves time, allowing IT departments to focus on higher-value tasks. However, the complexity involved in script maintenance and the need for updating scripts as technology evolves can pose challenges. Properly secured scripts are essential to protect sensitive data collected .

A script retrieves the serial number of a laptop using PowerShell by executing the command (Get-WmiObject Win32_BIOS).SerialNumber, which accesses the Windows Management Instrumentation (WMI) to fetch system BIOS information. Accessing the serial number is significant for system management as it uniquely identifies hardware, aiding in inventory tracking, warranty verification, and ensuring compliance with asset management policies .

The script uses a function to iterate through known registry paths associated with different MS Office versions (e.g., 'HKLM:\SOFTWARE\Microsoft\Office\16.0\Registration') to check for the existence of a DigitalProductID. If no key is found, it implies that MS Office might not be installed or improperly recorded in the registry, which can impact productivity and adherence to software compliance policies as MS Office is a critical productivity tool in most business environments .

The PowerShell command (Get-WmiObject -Query 'SELECT * FROM SoftwareLicensingService').OA3xOriginalProductKey is used to retrieve the Windows OS product key, which is stored in the system's Windows Management Infrastructure. This key is important for software compliance because it proves the legitimacy of the installed Windows OS, enabling organizations to ensure they are using licensed copies and adhering to Microsoft's software licensing agreements .

A Windows OS licensing status can be assessed through a PowerShell script using a command like slmgr /dlv, which provides detailed licensing information about the operating system. This assessment is crucial for IT audits as it enables organizations to verify that all operating systems in use are legally licensed, thereby avoiding potential legal issues and ensuring compliance with corporate IT governance standards .

Retrieving a digital product ID using scripts enhances an organization's software management policies by providing precise identification of installed software products, enabling efficient tracking of licensing status. It helps ensure compliance with licensing agreements, prevents unauthorized software use, and facilitates effective license renewal processes, optimizing software usage and budgeting .

The command 'ipconfig /all' provides detailed information about the network configuration of a system, including IP addresses, subnet masks, default gateways, DNS servers, and MAC addresses. This information is crucial for troubleshooting network issues as it helps identify misconfigurations, conflicting addresses, or missing settings that could cause connectivity problems .

You might also like