IsValid
Determines whether the license key being checked is a valid license.
Syntax
bool IsValid {get;}
Property value
Returns true if the license is valid, or false if the license key is not valid
or has expired.
Discussion
This property returns true if the license key is a valid license, or false if
the license key is invalid. The property also returns false if the license key
checked is an expired evaluation license.
Example
The following code sample illustrates using IsValid in a script:
...
set objCollection cims.LoadLicenses
for each objLics in objCollection
for each objLic in objLics
set objKeys = objLic.keys
i = 0
do while i \< objKeys.Count
set objKey = objKeys(0)
If not objKey.isValid then
wScript.Echo "Invalid License Key"
wscript.Quit
end if
i = i + 1
loop
next
wScript.Echo ""
next
...