Microsoft Baseline Security Analyzer (MBSA)
MBSA Scripting Samples
How To: Use the Microsoft Baseline Security Analyzer