Returns product activation information for a computer.

This script was tested using Python 2.2.2-224 for Microsoft Windows, available from ActiveState.

Python
Edit|Remove
import win32com.client
strComputer = "."
objWMIService = win32com.client.Dispatch("WbemScripting.SWbemLocator")
objSWbemServices = objWMIService.ConnectServer(strComputer,"root\cimv2")
colItems = objSWbemServices.ExecQuery("Select * from Win32_WindowsProductActivation")
for objItem in colItems:
    print "Activation Required: ", objItem.ActivationRequired
    print "Caption: ", objItem.Caption
    print "Description: ", objItem.Description
    print "Is NotificationOn: ", objItem.IsNotificationOn
    print "Product ID: ", objItem.ProductID
    print "Remaining Evaluation Period: ", objItem.RemainingEvaluationPeriod
    print "Remaining Grace Period: ", objItem.RemainingGracePeriod
    print "Server Name: ", objItem.ServerName
    print "Setting ID: ", objItem.SettingID