I am currently working on a script to scan list of network computers to see if our current network patch management process is working correctly. I am currently using "Microsoft Baseline Security Analyze" software to complete this task. Pacifically the use of “mbsacli.exe command line utility” to read from a text document (list the host computers) and check for missing patches… I have completed the script in power shell editor but keep running it a problem with the script not reading the ‘servers.txt” file where I have list of about 200 computers to check as a test.
I have setup the patch dir for the output of reports to “C:\PS\MBSA\Reports\NewRep
orts" and the source of the documents “servers.txt” in the following location.” C:\PS\MBSA\servers.txt”. I use the following .\Get-MBSAStats.ps1 -h C:\PS\MBSA\servers.txt” as the input for the “Host” object but I get the following error when I run it it. I have attached the powershell script as part of this question if you wish to look at what I have done so far with the script.
cmd.exe : Microsoft Baseline Security Analyzer
At line:1 char:4
+ cmd <<<< /c mbsacli /listfile "Host" /n OS+SQL+IIS+Password
+ CategoryInfo : NotSpecified: (Microsoft Baseline Security Analyzer:String) , RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Version 2.1.1 (2.1.2112.0)
(C) Copyright 2002-2009 Microsoft Corporation. All rights reserved.
Error: Cannot open file Host
There are no valid hosts, now exiting