troubleshooting Question

Mbsacli.exe script

Avatar of Mike
MikeFlag for United States of America asked on
VulnerabilitiesShell ScriptingIT Administration
5 Comments1 Solution2337 ViewsLast Modified:
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\NewReports" 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.

Error Message:

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


Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros