strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" _
    & strComputer & "\root\cimv2")
Set colWPA = objWMIService.ExecQuery _
    ("Select * from Win32_WindowsProductActivation")
For Each objWPA in colWPA
	If objWPA.ActivationRequired = 0 Then
		Wscript.Echo "This Windows system does not need to be activated."
	Else
		Wscript.Echo "This Windows system DOES need to be activated." & vbNewline & _
			"Remaining Evaluation Period: " & _
        objWPA.RemainingEvaluationPeriod & vbNewline & _
      "Remaining Grace Period: " _
        & objWPA.RemainingGracePeriod
	End If
Next