I'm not really sure this is the right forum for this... but I am using VBScript, so here goes.
What I'm doing is writing a script that reads in MBSA XML files and gathers some information. The script is doing find in reading the XML and gathering some information from the said XML files and formatting it into a more human readable text file. All is well in that respect. however, now I need to get some information that isn't in the XML. Specifically, I need to get the Executive Summary for the patch that is needed.
For instance consider the following:
What I want is the following:
Now, I can do this by the following code:
...but, if MS decides to recode their website, I get to recode my script. I would much rather connect to their database and grab what I want, rather than scrape their website. Any ideas how I might accomplish this? I haven't been able to find anything with Google.
This will be part of a large effort among multiple customers, so I can't count on a WSUS server, or any other patch management software other than MBSA.
"Nothing is so common-place as the wish to be remarkable."
--Shakespear
What I'm doing is writing a script that reads in MBSA XML files and gathers some information. The script is doing find in reading the XML and gathering some information from the said XML files and formatting it into a more human readable text file. All is well in that respect. however, now I need to get some information that isn't in the XML. Specifically, I need to get the Executive Summary for the patch that is needed.
For instance consider the following:
What I want is the following:
Code:
This security update resolves a privately reported vulnerability in Microsoft Windows. The vulnerability could allow elevation of privilege when an authenticated attacker deletes a printer connection. An attacker must have valid logon credentials and be able to log on to exploit this vulnerability.
This security update is rated Important for all supported editions of Windows Vista, Windows Server 2008, Windows 7, Windows Server 2008 R2, Windows 8, Windows Server 2012, and Windows RT. For more information, see the subsection, Affected and Non-Affected Software, in this section.
The security update addresses the vulnerability by correcting how the Windows Print Spooler allocates memory when a printer connection is deleted. For more information about the vulnerability, see the Frequently Asked Questions (FAQ) subsection for the specific vulnerability entry under the next section, Vulnerability Information.
Now, I can do this by the following code:
Code:
Function GetHTTPText(url)
''' Gets the Executive Summary from the InformationURL, parsing off the Recommendation
Dim http, httpxml, xml, fromChar, toChar
Set http = CreateObject("MSXML2.ServerXMLHTTP.6.0")
http.Open "GET", url, False
http.Send ""
httpxml = http.ResponseText
fromChar = InStr(httpxml,"Executive Summary")
toChar = InStr(httpxml,"<strong>Recommendation.</strong>")
If fromChar > 0 And toChar > 0 Then
httpxml = Mid(httpxml,fromChar,(toChar - fromChar))
httpxml = Replace(httpxml, "Executive Summary</h4></header><p>", "")
httpxml = Replace(httpxml, "</p><p>", vbCrLf & vbCrLf)
httpxml = Replace(httpxml, "<strong>", "")
httpxml = Replace(httpxml, "</strong>", "")
Else
httpxml = ""
End If
GetHTTPText = httpxml
End Function
...but, if MS decides to recode their website, I get to recode my script. I would much rather connect to their database and grab what I want, rather than scrape their website. Any ideas how I might accomplish this? I haven't been able to find anything with Google.
This will be part of a large effort among multiple customers, so I can't count on a WSUS server, or any other patch management software other than MBSA.
"Nothing is so common-place as the wish to be remarkable."
--Shakespear