Occasionally when I talk with FCS customers they are interested in determining the state or health of an FCS client in a script. This script might be used for a computer login script, VPN access script, or network quarantining solution (not NAP for which FCS already has a plugin). A few customers would like to see the information that is typically shown in the FCS user interface(UI) when the FCS UI is restricted via policy.
The sample below uses several of the registry keys described in the FCS documentation to output information similar to what is presented in the FCS Home and Help>About UI.
Microsoft Forefront Client Security version: 1.5.1973.0 Engine version: 1.1.5605.0 Antivirus Definition: Version 1.79.1025.0 created on 4/2/2010 4:26:40 AM Antispyware Definition: Version 1.79.1025.0 created on 4/2/2010 4:26:41 AM Last scan: 4/2/2010 4:00:01 AM (Quick Scan)
This script was written so that it could be easily extended and plugged into other solutions or have your business logic applied. For example you can easily determine if a scan has been run today or if definitions were updated this week by add a line or two:
WScript.echo "Scanned today? : " & CBool(DateDiff("d",LastScanTime,Now)<=1) WScript.echo "Updated definitions this week? : " & CBool(DateDiff("d",AV_BuildDate,Now)<=7)
As the disclaimer says, the sample itself is not supported by Microsoft, but I hope that you find it useful.
Ed Price MSFT edited Original. Comment: Minor title and line spacing updates. Cleaned up and added tags.