Please refer the script monitoring to triggers an alert if windows is about to expire within 30 days and counting to less. Also it triggers alert if windows has already expired.
Output of the script shows you the days, which has left.
Please refer the wiki guide for how to use the custom monitoring scripts:
Tested OS : This script has tested on Windows(7),Windows(8,8.1), Windows(10) Machines