01-30-2008 06:31 AM
01-30-2008 07:04 AM
01-30-2008 07:19 AM
01-31-2008 08:47 AM
You can find the location where "Backup Exec RemoteAgent for Windows Systems" service is installed by querying the value of"ImagePath" registry key under "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BackupExecAgentAccelerator"on the remote machine. Once you have the full path, you can get the moduleversion information of the application using VerQueryValue() API.
01-31-2008 12:45 PM
const HKEY_LOCAL_MACHINE = &H80000002const ADS_SCOPE_SUBTREE = 2set objFSO = CreateObject("Scripting.FileSystemObject")set objReport = objFSO.CreateTextFile("backupExecReport.xml")Write "<—xml-stylesheet type=""text/xsl"" href=""backupExecReport.xsl""–>"Write "<backupExec>"
'
' Edit here
'
ScanAD("LDAP://OU=Servers,DC=Domain,DC=com")'Report "computername"Write "</backupExec>"sub ScanAD(strOU) set objConnection = CreateObject("ADODB.Connection") set objCommand = CreateObject("ADODB.Command") objConnection.Provider = "ADsDSOObject" objConnection.Open "Active Directory Provider" set objCommand.ActiveConnection = objConnection objCommand.CommandText = _ "Select Name, Location from '" & strOU & "' " _ & "Where objectClass='computer'" objCommand.Properties("Page Size") = 1000 objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE Set objRecordSet = objCommand.Execute objRecordSet.MoveFirst Do Until objRecordSet.EOF wscript.echo "Checking " & objRecordSet.Fields("Name").Value Report(objRecordSet.Fields("Name").Value) objRecordSet.MoveNext Loopend subsub Report(strComputer) on error resume next set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _ strComputer & "\root\default:StdRegProv") ' Backup Exec 11 Agent strKeyPath = "SOFTWARE\Symantec\Backup Exec For Windows\Remote Agent for Windows Servers\Install" strValueName = "Path" objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strPath if Err.Number <> 0 then strPath = "" Err.Clear end if strValueName = "Version" objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strVersion if Err.Number <> 0 then strVersion = "" Err.Clear end if ' Backup Exec 11 Open File Option strKeyPath = "SOFTWARE\Symantec\Backup Exec For Windows\Open File Option\Install" strValueName = "Version" objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strOpenFileVersion if Err.Number <> 0 then strOpenFileVersion = "" Err.Clear end if ' clear resume next on error goto 0 if objFSO.FolderExists(ConvertToNetwork(strComputer,strPath)) then strMode = "registry" strNetworkPath = ConvertToNetwork(strComputer,strPath) bCheck = true elseif objFSO.FolderExists(ConvertToNetwork(strComputer,"c:\Program Files\Symantec\Backup Exec\RAWS\")) then strMode = "file" strNetworkPath = ConvertToNetwork(strComputer,"c:\Program Files\Symantec\Backup Exec\RAWS\") bCheck = true end if if bCheck then Write "<server mode=""" & strMode & """>" Write " <name>" & strComputer & "</name>" Write " <version>" & strVersion & "</version>" Write " <path>" & strPath & "</path>" Write " <openFileOption>" if strOpenFileVersion <> "" then Write " <installed>true</installed>" else Write " <installed>false</installed>" end if Write " <version>" & strOpenFileVersion & "</version>" Write " </openFileOption>" Write " <files>" set objFolder = objFSO.GetFolder(strNetworkPath) for each objFile in objFolder.Files Write " <file version=""" & objFSO.GetFileVersion(objFile.Path) & """>" & objFile.Name & "</file>" next Write " </files>" Write "</server>" end ifend subsub Write(strValue) 'wscript.echo strValue objReport.writeline strValueend subfunction ConvertToNetwork(strComputer, strPath) if strPath <> "" then ConvertToNetwork = "\\" & strComputer & "\" & left(strPath, 1) & "$" & right(strPath, len(strPath) - 2) else ConvertToNetwork = "" end ifend function
<—xml version="1.0"–><xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" encoding="iso-8859-1" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" indent="yes" /> <xsl:template match="backupExec"> <html xml:lang="en"> <head> <title>BackupExec Agents</title> </head> <body> <div id="container"> Agents Found: <xsl:value-of select="count(server)"/><br /> <xsl:apply-templates select="server"> <xsl:sort select="name" data-type ="text" /> </xsl:apply-templates> </div> </body> </html> </xsl:template> <xsl:template match="server"> <xsl:value-of select="name"/> <ul> <li> version: <xsl:value-of select="version" /> </li> <li> open file option: <xsl:value-of select="openFileOption/installed" /> </li> </ul> <br /> </xsl:template> <!-- General Functions --> <xsl:template name="alternated-row"> <xsl:attribute name="class"> <xsl:if test="position() mod 2 = 1">row-0</xsl:if> <xsl:if test="position() mod 2 = 0">row-1</xsl:if> </xsl:attribute> </xsl:template></xsl:stylesheet>
01-31-2008 12:55 PM
01-31-2008 01:17 PM
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
An invalid character was found in text content. Error processing resource 'file:///Z:/BEAgent/backupExecReport.xml'. Line ...
<
01-31-2008 01:33 PM
<server mode="registry">
<name>ServerName</name>
<version>****</version>
<path>C:\Program Files\Symantec\Backup Exec\RAWS\</path>
<openFileOption>
<installed>false</installed>
<version></version>
</openFileOption>
<files>
...
<file version="...">...</file>
...
</files>
</server>
02-01-2008 06:47 AM
02-01-2008 07:40 AM
02-01-2008 08:30 AM
02-01-2008 08:40 AM
02-01-2008 08:51 AM
02-01-2008 08:58 AM
02-01-2008 09:57 AM
02-01-2008 11:23 AM
02-04-2008 07:03 AM
To prevent those errors, you need to edit a single line in the XSL file, and a single line in the .VBS fileChange:
backupExecReport.vbsCode:Write "<-xml-stylesheet type=""text/xsl"" href=""backupExecReport.xsl""->"
backupExecReport.xslCode:<-xml version="1.0"->
You see those red dashes in gbeck's scripts? Change them to question marks. The forum mangles them when you try and post question marks.Once that's done it seems to work fine.