Check for Windows Activation for a group of nodes

# Define list of nodes to check
$servers = Get-Content -Path "C:\TEMP\AllNodes.txt" 
# Query activation status
foreach ($server in $servers) {
    $activation = Get-WmiObject -Query "SELECT * FROM SoftwareLicensingProduct WHERE (PartialProductKey IS NOT NULL)" -ComputerName $server
    if ($activation) {
        Write-Host "Server $server is activated."
    } else {
        Write-Host "Server $server is not activated."

Leave a Reply

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