Skip to content

Instantly share code, notes, and snippets.

@mbrownnycnyc
Last active December 17, 2015 10:18
Show Gist options
  • Save mbrownnycnyc/5593449 to your computer and use it in GitHub Desktop.
Save mbrownnycnyc/5593449 to your computer and use it in GitHub Desktop.
super quick batch script to run microsoft baseline security analyzer against a given list of PCs
@echo off
echo > "%temp%/mbsalistfile.txt"
for %%G in (%*) do echo %%G >> "%temp%/mbsalistfile.txt"
"%programfiles%\Microsoft Baseline Security Analyzer 2\mbsacli.exe" /nvc /n "OS"+"SQL"+"IIS"+"PASSWORD" /wa /nd /listfile "%temp%/mbsalistfile.txt"
"%programfiles%\Microsoft Baseline Security Analyzer 2\mbsacli.exe" /l /rd "%userprofile%\securityscans"
pause
REM the mbsa files are xml and can be compared as such.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment