Microsoft Baseline Security Analyzer with xp_cmdshell

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Dennis Joergensen (anonymous_at_discussions.microsoft.com)
Date: 05/04/04


Date: Tue, 4 May 2004 12:41:08 -0700

Hello

I'm trying to import reports from Microsoft Baseline Security Analyzer into a database. I should be maded by a DTS Package, with one Execute SQL Task and one ActiveX Script Task.

The Execute SQL Task should make a cursor for getting the servers from a tabel, and then call Microsoft Baseline Security Analyzer (msbacli.exe) with xp_cmdshell for each server.

The ActiveX Script Task should then import the XML report files via SQLXML 3.0 Bulk Load into a tabel.

(The reason not for just calling msbacli.exe once in hfnetchk mode with a hostfile, is because it only supports 128 servers, even though that the documentation says 256)

Anyway the problem is that I can get MSBACli.exe to work with xp_cmdshell. I'm running with a security context of a user with sysadmin membership. The same user as the SQL Server Service. So it's not a security problem.

Here is the code, and the output:

DECLARE @result int EXEC @result = xp_cmdshell '"C:\Program Files\Microsoft Baseline Security Analyzer\mbsacli.exe"'

Microsoft Baseline Security Analyzer
Version 1.2 (1.2.3316.1)
(C) Copyright 2002-2004 Microsoft Corporation. All rights reserved.
HFNetChk developed for Microsoft Corporation by Shavlik Technologies, LLC.
(C) Copyright 2002-2004 Shavlik Technologies, LLC. www.shavlik.com

No computers were found.
Unable to load XML data.

If i try to specify a computer, it's the same:

DECLARE @result int EXEC @result = xp_cmdshell '"C:\Program Files\Microsoft Baseline Security Analyzer\mbsacli.exe" /i 192.168.0.2'

Microsoft Baseline Security Analyzer
Version 1.2 (1.2.3316.1)
(C) Copyright 2002-2004 Microsoft Corporation. All rights reserved.
HFNetChk developed for Microsoft Corporation by Shavlik Technologies, LLC.
(C) Copyright 2002-2004 Shavlik Technologies, LLC. www.shavlik.com

No computers were found.
Unable to load XML data.

What is the problem? When i run mbsacli.exe in a command prompt with the same parameteres, it works fine.

Please help. You are also welcome if you got another and easy way to scan and import security reports into a database?

Regards Dennis



Relevant Pages

  • Re: Microsoft Baseline Security Analyzer
    ... This posting is provided "AS IS" with no warranties, and confers no rights. ... scan any client on my environment it say (no critical update available), ... this a bug in Microsoft Baseline Security Analyzer or what? ...
    (microsoft.public.windowsupdate)
  • Re: Repair Installation after failed SP2 .. now what about updates?
    ... Now when I go to the Windows Update site, ... I suggest you download and run the Microsoft Baseline Security ... Microsoft Baseline Security Analyzer (MBSA): ... The Microsoft Baseline Security Analyzer allows administrators to ...
    (microsoft.public.windowsupdate)
  • Re: Off line updates
    ... I suggest you download and run the Microsoft Baseline Security ... MS Office updates though): ... Microsoft Baseline Security Analyzer (MBSA): ... The Microsoft Baseline Security Analyzer allows administrators to ...
    (microsoft.public.windowsupdate)
  • Re: Big WMI memory leak on NT4 when accessing Win32_QuickFixEngineerin
    ... WMI Win32_QuickFixEngineering Queries Cause Winmgmt Process to Hang ... take a look at the Microsoft Baseline Security ... Microsoft Baseline Security Analyzer (MBSA): ... The Microsoft Baseline Security Analyzer allows administrators to ...
    (microsoft.public.scripting.vbscript)
  • RE: Microsoft Baseline Security Analyzer
    ... The MBSA stores the reports in XML format in C:\Documents and ... You can also use MSXML or another XSLT processor to transform these reports ... Subject: Microsoft Baseline Security Analyzer ...
    (Focus-Microsoft)