Installation for WebLogic 12cR1 application server on Windows

Microsoft.JEE.WebLogic.12cR1.Windows.Installation.Discovery (Discovery)

Discovers WebLogic application server installations on Windows.

Knowledge Base article:

Summary

The installation discovery locates the default installation path of the WebLogic application server.

Element properties:

TargetMicrosoft.Windows.Server.Computer
EnabledTrue
Frequency14400
RemotableFalse

Object Discovery Details:

Discovered Classes and their attribuets:

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.Windows.TimedScript.DiscoveryProvider Default

Source Code:

<Discovery ID="Microsoft.JEE.WebLogic.12cR1.Windows.Installation.Discovery" Target="Windows!Microsoft.Windows.Server.Computer" Remotable="true" Enabled="true">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="Microsoft.JEE.WebLogic.12cR1.Windows.Installation"/>
</DiscoveryTypes>
<DataSource ID="DS" TypeID="Windows!Microsoft.Windows.TimedScript.DiscoveryProvider">
<IntervalSeconds>14400</IntervalSeconds>
<SyncTime/>
<ScriptName>Microsoft.JEE.WebLogic.12cR1.Install.Discover.vbs</ScriptName>
<Arguments>$MPElement$ $Target/Id$ "$MPElement[Name='Microsoft.JEE.WebLogic.12cR1.Windows.Installation']$" $Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Arguments>
<ScriptBody><Script>
''' Copyright (c) Microsoft Corporation. All rights reserved.
'''
''' Date Created: Mar 21st, 2011
'
SetLocale("en-us")
'' Check if a file is too big (larger than or equal to 100 MB).
'' Return true if too big, else return false.
'' If a file does not exist, return false.
FUNCTION isFileTooBig(userSuppliedFSO, filePath, fileName)
''Set the maximum file size to 100MB
const maxFileSize = 104857600
Dim strFile, myFSO
isFileTooBig = false
strFile = filePath &amp; fileName
IF userSuppliedFSO is Nothing THEN
SET myFSO = CreateObject("Scripting.FileSystemObject")
ELSE
SET myFSO = userSuppliedFSO
END IF
IF myFSO.FileExists(strFile) = true then
'' Get a File object from a file system
set objFile = myFSO.GetFile(strFile)
'' Get the file size
fileSize = objFile.Size
IF fileSize &gt;= maxFileSize THEN
isFileTooBig = true
END IF
END IF
END FUNCTION
'
' Method to parse out a command line arguments
' The arguments can be
'
'
Function ParseOutCommandLineArg(cmdLine, arg)
Dim done
Dim pos
Dim quoted
Dim startpos
Dim gotKey
gotkey = false
quoted = false
pos = 1
startpos = 1
done = false
While not done
Select Case mid ( cmdLine , pos , 1 )
Case ""&amp;chr(34)
If gotkey and quoted Then
ParseOutCommandLineArg = mid(cmdLine,startpos,pos-startpos)
done = true
else
quoted = not quoted
End If
startpos = pos+1
Case "="
If arg = mid(cmdline,startpos,pos-startpos) Then
startpos = pos+1
gotkey = true
End If
Case " "
If gotkey Then
If not quoted Then
ParseOutCommandLineArg = mid(cmdLine,startpos,pos-startpos)
done = true
End If
Else
If arg = mid(cmdline,startpos,pos-startpos) Then
startpos = pos+1
gotkey = true
End If
End If
If not quoted Then
startpos = pos+1
End If
End Select
pos = pos + 1
if not done then
if pos &gt;len(cmdLine) Then
If gotkey Then
If not quoted Then
ParseOutCommandLineArg = mid(cmdLine,startpos,pos-startpos)
done = true
End If
End If
done = true
End If
End If
Wend
End Function
'
' Method to log an error to the windows event log
'
Function LogError(oAPI, scriptName, description)
Call oAPI.LogScriptEvent(scriptName, 100, 1, description)
End Function
'
' Method to log an error when failing to find a file
'
Function LogErrorFileNotFound(oAPI, scriptName, fileName)
LogError oAPI, scriptName, "Could not find expected configuration file: " &amp; fileName
End Function
'
' Method to log an error when failing to find a folder
'
Function LogErrorFolderNotFound(oAPI, scriptName, folderName)
LogError oAPI, scriptName, "Could not find expected folder: " &amp; folderName
End Function
'
' Method to log an error when failing to parse a file
'
Function LogErrorParsingFile(oAPI, scriptName, fileName)
LogError oAPI, scriptName, "Failed to parse configuration file: " &amp; fileName
End Function
'
' Method to log an error when failing to commuincate over HTTP
'
Function LogErrorHTTP(oAPI, scriptName, url, description, errorNumber)
LogError oAPI, scriptName, "HTTP commucation failed with: " &amp; url &amp; " - " &amp; description &amp; " - " &amp; CStr(errorNumber)
End Function

'' Copyright (c) Microsoft Corporation. All rights reserved.
'''
''' Filters out discovered instances that do not match the specified major version
''' Returns true if the desired version is the Major version.
'''
''' i.e. if desired major version is 6 and given 6.0.22, the result is true.
''' if desired major version is 6 and given 5.0.12, the result is false
'''
PUBLIC FUNCTION FilterVersion(strDesiredMajorVersion, strActualVersion)
FilterVersion = FALSE
' Filter out specific version.
' Need to be careful that the given filter is not longer
' than the string to be filtered, otherwise just make sure that
' what is at the beginning of one string matches the filter
IF (0 &lt; Len(strDesiredMajorVersion)) AND (Len(strDesiredMajorVersion) &lt;= Len(strActualVersion)) THEN
IF (0 = StrComp(strDesiredMajorVersion, Left(strActualVersion, Len(strDesiredMajorVersion)))) THEN
FilterVersion = TRUE
END IF
END IF
END FUNCTION

' Copyright (c) Microsoft Corporation. All rights reserved.
' Date Created: November 8th, 2010
'
' This script is to be incorporated into the WebLogic JEE MP. This script will discover
' installations of WebLogic application servers installed with Administrator privileges.
' This encompasses installs by the Windows executable as well as the JAR-based
' installation from an elevated command prompt. The script looks into the registry
' entries for the local machine like:
'
' * HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Oracle Weblogic
' or
' * HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Oracle Weblogic
'
' and finds a string that has a path to the WebLogic uninstaller,
' from this string it parses out the location of the installation base.
'
' Sometimes WebLogic could be installed by the JAR based install (i.e. 64-bit) without
' administrative privileges. For these scenarios the desired uninstall string is not
' present from a system-wide location (for instance, WebLogic will not appear in the
' Windows list of programs to uninstall). For these scenarios there has been a registry
' entry added to the local user account. For this case each user account must be examined.
'
SETLOCALE("en-us")
CONST HKEY_LOCAL_MACHINE = &amp;H80000002
CONST HKEY_USERS = &amp;H80000003
CONST KEY_QUERY_VALUE = &amp;H0001
CONST ORACLE_WEBLOGIC = "\Oracle WebLogic"
CONST QUICKSTART_LNK = "\QuickStart.lnk"
CONST UNINSTALL_CMD = "\uninstall\uninstall.cmd" ' For EXE installs
CONST UNINSTALL_EXE = "\uninstall\uninstall.exe" ' For (non-Admin) JAR installs
CONST UNINSTALL_LNK = "Uninstall Oracle WebLogic.lnk"
CONST UNKNOWN = "UNKNOWN"
CONST VERSION_MINOR_10GR3 = 3
CONST VERSION_REVISION_10GR3 = 0
CONST WEBLOGIC_BRANDED_VERSION_10GR3 = "10gR3"
CONST WEBLOGIC_BRANDED_VERSION_11GR1 = "11gR1"
Const WEBLOGIC_BRANDED_VERSION_12CR1 = "12cR1"
CONST WEBLOGIC_INSTALLATIONS_SCRIPT_NAME = "WebLogicInstallations.vbs"
'''
''' Simple Class defining a WebLogic installation
'''
CLASS WebLogicInstallation
PUBLIC InstallationPath
PUBLIC Status
PUBLIC UninstallString
PUBLIC Version
END CLASS
'
' A boolean FUNCTION that checks if the given registry key has sub keys.
' Returns true if the key exisits, otherwise false
'
PRIVATE FUNCTION CheckIfRegistryKeyHasSubKeys(objRegistry, keyToCheck)
DIM arrSubKeys
objRegistry.EnumKey HKEY_LOCAL_MACHINE, keyToCheck, arrSubKeys
DIM returnValue
returnValue = FALSE
IF NOT IsNull(arrSubKeys) THEN
returnValue = TRUE
END IF
CheckIfRegistryKeyHasSubKeys = returnValue
END FUNCTION
'''
''' Parse the registry.xml file and determine the version
'''
PRIVATE FUNCTION DetermineWebLogicVersion(oAPI, userSuppliedFSO, installationPath, userSuppliedXmlDom)
DIM objXMLDoc, objXmlNode, returnValue
DIM fso, strFilePath, strFileName
returnValue = "UNKNOWN"
IF userSuppliedXmlDom IS NOTHING THEN
SET objXMLDoc = CreateObject("Microsoft.XMLDOM")
ELSE
SET objXMLDoc = userSuppliedXmlDom
END IF
objXMLDoc.async = FALSE
If userSuppliedFso Is Nothing Then
Set fso = CreateObject("Scripting.FileSystemObject")
Else
Set fso = userSuppliedFso
End If
strFilePath = installationPath &amp; "\"
strFileName = "registry.xml"
If (Not fso.FileExists(strFilePath &amp; strFileName)) Or isFileTooBig(fso, strFilePath, strFileName) Then
LogErrorFileNotFound oAPI, WEBLOGIC_INSTALLATIONS_SCRIPT_NAME, strFilePath &amp; strFileName
DetermineWebLogicVersion = returnValue
Exit Function
End If
objXMLDoc.load(strFilePath &amp; strFileName)
DIM strLevel, strServicePackLevel, strPatchLevel
SET objXmlNode = objXMLDoc.selectSingleNode("/bea-product-information/host/product/release")
IF NOT (objXmlNode IS NOTHING) THEN
strLevel = objXmlNode.getAttribute("level")
strServicePackLevel = objXmlNode.getAttribute("ServicePackLevel")
strPatchLevel = objXmlNode.getAttribute("PatchLevel")
returnValue = strLevel &amp; "." &amp; strServicePackLevel &amp; "." &amp; strPatchLevel
END IF
DetermineWebLogicVersion = returnValue
END FUNCTION
'''
''' Parse the registry.xml file and determine the version
'''
PRIVATE FUNCTION DetermineWebLogicStatus(oAPI, userSuppliedFSO, installationPath, userSuppliedXmlDom)
DIM objXMLDoc, objXmlNode, returnValue
DIM fso, strFilePath, strFileName
returnValue = "UNKNOWN"
IF userSuppliedXmlDom IS NOTHING THEN
SET objXMLDoc = CreateObject("Microsoft.XMLDOM")
ELSE
SET objXMLDoc = userSuppliedXmlDom
END IF
objXMLDoc.async = FALSE
If userSuppliedFso Is Nothing Then
Set fso = CreateObject("Scripting.FileSystemObject")
Else
Set fso = userSuppliedFso
End If
strFilePath = installationPath &amp; "\"
strFileName = "registry.xml"
If (Not fso.FileExists(strFilePath &amp; strFileName)) Or isFileTooBig(fso, strFilePath, strFileName) Then
LogErrorFileNotFound oAPI, WEBLOGIC_INSTALLATIONS_SCRIPT_NAME, strFilePath &amp; strFileName
DetermineWebLogicStatus = returnValue
Exit Function
End If
objXMLDoc.load(strFilePath &amp; strFileName)
DIM strStatus
SET objXmlNode = objXMLDoc.selectSingleNode("/bea-product-information/host/product/release")
IF NOT (objXmlNode IS NOTHING) THEN
returnValue= objXmlNode.getAttribute("Status")
END IF
DetermineWebLogicStatus = returnValue
END FUNCTION
'''
''' Return a list of the known registry locations for WebLogic
''' Depending on the installer/OS architecture
'''
PRIVATE FUNCTION GetWindowsUninstallRegistryKeys()
DIM returnValue
SET returnValue = CreateObject("Scripting.Dictionary")
returnValue.add "x86", "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
returnValue.add "x64", "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
SET GetWindowsUninstallRegistryKeys = returnValue
END FUNCTION
'''
''' Parse out the installation path from the uninstall command string.
'''
''' An entry like:
'''
''' "C:\Oracle\Middleware3\wlserver_10.3\uninstall\uninstall.cmd"
'''
''' should yield:
'''
''' C:\Oracle\Middleware3
'''
PRIVATE FUNCTION ParseUninstallString(targetUninstallString, stringToLookFor)
DIM tempString
' Remove all double quotes
tempString = Replace(targetUninstallString, chr(34), "")
' Step 1) Parse off the uninstall command
DIM index
index = InStrRev(tempString, stringToLookFor)
tempString = Left(tempString, index - 1 )
' Step 2) Parse off the last directory, typically this might
' be something like wlserver_10.3
index = InStrRev(tempString, "\")
tempString = Left(tempString, index - 1 )
ParseUninstallString = tempString
END FUNCTION
'''
''' Return array of WebLogic Installation instances
''' for each install of Web Logic. It is possible that
''' there can be more than one installation of WebLogic
''' on a machine.
'''
''' For each installation, in the Microsoft Windows Uninstall
''' registry there is a string to execute the uninstall
''' of WebLogic. This is a fullpath to the uninstall command.
''' From the uninstall string, it is possible to parse-out
''' the base installation directory.
'''
PUBLIC FUNCTION FindWebLogicInstallations(oAPI, objRegistry, userSuppliedXmlDom, userSuppliedFileSystem, userSuppliedShellApp)
DIM returnValue
SET returnValue = CreateObject("Scripting.Dictionary")
DIM UninstallRegKeys, UninstallKey
SET UninstallRegKeys = GetWindowsUninstallRegistryKeys()
FOR EACH UninstallKey in UninstallRegKeys
FindWebLogicInstallationsHklmHelper oAPI, objRegistry, userSuppliedXmlDom, userSuppliedFileSystem, UninstallRegKeys.Item(UninstallKey), returnValue
NEXT
FindWebLogicInstallationsHkUsersHelper oAPI, objRegistry, userSuppliedXmlDom, userSuppliedFileSystem, userSuppliedShellApp, returnValue
SET FindWebLogicInstallations = returnValue
END FUNCTION
'''
''' Loop through the registry's uninstall locations: both 32- and 64-bit. Look for an
''' entry starting with the string "Oracle WebLogic" that has string values. Just because
''' the subkey exists, does not mean that there are values associated with the key (the
''' uninstaller leaves cruft).
'''
''' The entries in the registry point to the location of the uninstall script. From this
''' fullpath parse out the location of the uninstall string.
'''
PRIVATE FUNCTION FindWebLogicInstallationsHklmHelper(oAPI, objRegistry, userSuppliedXmlDom, userSuppliedFileSystem, UninstallKey, returnValue)
IF CheckIfRegistryKeyHasSubKeys(objRegistry, UninstallKey) THEN
' Loop through all of the uninstall files looking for a sub
' key that looks like an Oracle Web Logic.
' For each of these, pull out the install path
' (assuming there are subkeys)
DIM arrSubKeys
objRegistry.EnumKey HKEY_LOCAL_MACHINE, UninstallKey, arrSubKeys
IF NOT IsNull(arrSubKeys) THEN
DIM subKey
FOR EACH subKey In arrSubKeys
DIM lookForOracleKeywords
lookForOracleKeywords = InStr(subKey, "Oracle WebLogic")
IF 0 &lt; lookForOracleKeywords THEN
DIM theKey, strValue, strUninstallString, objWebLogic
SET objWebLogic = NEW WebLogicInstallation
DIM fullSubKey
fullSubKey = UninstallKey &amp; "\" &amp; subKey
objRegistry.GetStringValue HKEY_LOCAL_MACHINE, fullSubKey, "UninstallString", strValue
IF "" &lt;&gt; strValue THEN
objWebLogic.UninstallString = strValue
objWebLogic.InstallationPath = ParseUninstallString(strValue, UNINSTALL_CMD)
objWebLogic.Status = DetermineWebLogicStatus(oAPI, userSuppliedFileSystem, objWebLogic.InstallationPath, userSuppliedXmlDom)
objWebLogic.Version = DetermineWebLogicVersion(oAPI, userSuppliedFileSystem, objWebLogic.InstallationPath, userSuppliedXmlDom)
returnValue.Add fullSubKey, objWebLogic
END IF
END IF ' END looking for Oracle Keywords
NEXT
END IF ' END isNull()
END IF ' END CheckIfRegistryKeyHasSubKeys()
END FUNCTION
'''
''' Look through each user for indication that WebLogic has been installed without
''' administrative privileges
'''
''' (1) Look at HKEY_OF_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StartPage\NewShortcuts
''' (2) From the entries in the registry, select the QuickStart.lnk file &amp; open the directory
''' where this link lives.
''' (3) In this directory there is a link for Uninstall Oracle WebLogic.
''' (4) Extract the uninstall string from this link
'''
PUBLIC FUNCTION FindWebLogicInstallationsHkUsersHelper(oAPI, objRegistry, userSuppliedXmlDom, userSuppliedFileSystem, userSuppliedShellApp, returnValue)
DIM objFileSystem
DIM areThereKeys, arrUserKeys, strUserKey, strKeyPath, strRegistryKey
IF userSuppliedFileSystem IS NOTHING THEN
SET objFileSystem = CreateObject("Scripting.FileSystemObject")
ELSE
SET objFileSystem = userSuppliedFileSystem
END IF
strRegistryKey = "\Software\Microsoft\Windows\CurrentVersion\Explorer\StartPage\NewShortcuts"
areThereKeys = objRegistry.EnumKey(HKEY_USERS, "", arrUserKeys)
IF NOT IsNull(arrUserKeys) THEN
FOR EACH strUserKey IN arrUserKeys
DIM arrShortcuts, strShortcut
strKeyPath = strUserKey + strRegistryKey
areThereKeys = objRegistry.EnumValues(HKEY_USERS, strKeyPath, arrShortcuts)
'
' If the enumeration returned back without error and the returned type is an array
IF areThereKeys = 0 AND 8204 = VarType(arrShortcuts) THEN
'
' This loop needs to look at the shortcuts and find one that contains something like:
' ...\Oracle WebLogic (BEAHOME 4)\QuickStart.lnk
' Be aware that the "(BEAHOME 4)" may or may not be present.
FOR EACH strShortcut IN arrShortcuts
DIM intLocationOfOracle
intLocationOfOracle = InStr(strShortcut, ORACLE_WEBLOGIC)
IF intLocationOfOracle &gt; 0 THEN
IF InStr(intLocationOfOracle, strShortcut, QUICKSTART_LNK) &gt; 0 THEN
DIM strShortcutParentDirectory, strUninstallLink
strShortcutParentDirectory = objFileSystem.GetParentFolderName(strShortcut)
strUninstallLink = strShortcutParentDirectory &amp; "\" &amp; UNINSTALL_LNK
'
' If the symbolic link exists, extract the necessary information
'
IF objFileSystem.FileExists(strUninstallLink) THEN
DIM strUninstallCmd, objWebLogic
strUninstallCmd = ExtractInformationFromShortcut(userSuppliedShellApp, strShortcutParentDirectory, UNINSTALL_LNK)
SET objWebLogic = NEW WebLogicInstallation
objWebLogic.UninstallString = strUninstallCmd
objWebLogic.InstallationPath = ParseUninstallString(strUninstallCmd, UNINSTALL_EXE)
objWebLogic.Status = DetermineWebLogicStatus(oAPI, objFileSystem, objWebLogic.InstallationPath, userSuppliedXmlDom)
objWebLogic.Version = DetermineWebLogicVersion(oAPI, objFileSystem, objWebLogic.InstallationPath, userSuppliedXmlDom)
returnValue.Add strUninstallCmd, objWebLogic
END IF ' End if of checking that the shortcut exists
END IF ' End if for if ends with Quickstart.lnk
END IF ' End if there is a Oracle WebLogic string
NEXT
END IF ' End of areThereKeys=0 for the shortcut array
NEXT
END IF ' End of areThereKeys=0 for Users array
END FUNCTION
'''
''' Extract the Path from a Shortcut. This cannot be done via the
''' FileSytem Object, instead the objShell needs to be used. It is assumed
''' that Version 5.0 or greater is used.
'''
PRIVATE FUNCTION ExtractInformationFromShortcut(userSuppliedShellApp, strDirectory, strLink)
DIM objShell, objFolder, objFolderItem, objLink
IF userSuppliedShellApp IS NOTHING THEN
SET objShell = CreateObject("Shell.Application")
ELSE
SET objShell = userSuppliedShellApp
END IF
SET objFolder = objShell.Namespace(strDirectory)
SET objFolderItem = objFolder.ParseName(strLink)
SET objLink = objFolderItem.GetLink
ExtractInformationFromShortcut = objLink.Path
END FUNCTION
''' Filters out discovered instances that do not match the specified major version for WebLogic
''' Unlike the other application servers, WebLogic's versioning scheme does not necessarily
''' match the actual version number found.
'''
''' Returns true if the desired version is the Major version.
'''
''' i.e. if desired major version is 10gR3 and given 10.3.0, the result is true.
''' if desired major version is 11gR1 and given 11.0.0, the result is true
''' if desired major version is 11gR1 and given 10.3.2, the result is true
''' if desired major version is 11gR1 and given 10.3.4, the result is true
'''
PUBLIC FUNCTION FilterWebLogicVersion(strDesiredMarketingVersion, strActualVersion)
DIM strMappedVersion
strMappedVersion = MapWebLogicVersion(strActualVersion)
IF 0 = StrComp(strDesiredMarketingVersion, strMappedVersion) THEN
FilterWebLogicVersion = TRUE
ELSE
FilterWebLogicVersion = FALSE
END IF
END FUNCTION
''' Map the actual version information to WebLogic marketing version
''' version consists of:
''' major.minor.revision
''' i.e. 10.3.2 maps to
''' major: 10
''' minor: 3
''' revision: 2
PUBLIC FUNCTION MapWebLogicVersion(strActualVersion)
DIM splitVersion
splitVersion = Split(strActualVersion, ".")
DIM minorVersion, revisionNumber
minorVersion = CInt(splitVersion(1))
revisionNumber = CInt(splitVersion(2))
SELECT CASE splitVersion(0)
CASE "10"
IF VERSION_MINOR_10GR3 = minorVersion THEN
IF VERSION_REVISION_10GR3 = revisionNumber THEN
MapWebLogicVersion = WEBLOGIC_BRANDED_VERSION_10GR3
ELSE
MapWebLogicVersion = WEBLOGIC_BRANDED_VERSION_11GR1
END IF
ELSEIF minorVersion &lt; VERSION_MINOR_10GR3 THEN
MapWebLogicVersion = WEBLOGIC_BRANDED_VERSION_10GR3
ELSE
MapWebLogicVersion = WEBLOGIC_BRANDED_VERSION_11GR1
END IF
CASE "11"
MapWebLogicVersion = WEBLOGIC_BRANDED_VERSION_11GR1
Case "12"
MapWebLogicVersion = WEBLOGIC_BRANDED_VERSION_12CR1
CASE ELSE
MapWebLogicVersion = UNKNOWN
END SELECT
END FUNCTION
'''
''' Create instances in OpsMgr for all found instances of WebLogic installations
'''
PUBLIC FUNCTION ReturnWebLogicInstallations(oAPI, oReg, SourceId, ManagedEntityId, WebLogicClassGuid, TargetComputer, WebLogicVersionFilter)
DIM oDiscoveryData, installations, installation, oInst
SET oDiscoveryData = oAPI.CreateDiscoveryData(0, SourceId, ManagedEntityId)
SET installations = FindWebLogicInstallations(oAPI, oReg, NOTHING, NOTHING, NOTHING)
FOR EACH installation IN installations.Keys
IF FilterWebLogicVersion(WebLogicVersionFilter, installations.item(installation).Version) THEN
SET oInst = oDiscoveryData.CreateClassInstance(WebLogicClassGuid)
CALL oInst.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", TargetComputer)
CALL oInst.AddProperty("$MPElement[Name='WebLogic!Microsoft.JEE.WebLogic.Windows.Installation']/InstallPath$", installations.item(installation).InstallationPath)
CALL oInst.AddProperty("$MPElement[Name='WebLogic!Microsoft.JEE.WebLogic.Windows.Installation']/Status$", installations.item(installation).Status)
CALL oInst.AddProperty("$MPElement[Name='WebLogic!Microsoft.JEE.WebLogic.Windows.Installation']/Version$", installations.item(installation).Version)
CALL oInst.AddProperty("$MPElement[Name='System!System.Entity']/DisplayName$", "WebLogic|" &amp; installations.item(installation).Version)
CALL oDiscoveryData.AddInstance(oInst)
END IF
NEXT
Call oAPI.Return(oDiscoveryData)
END FUNCTION

Dim oArgs, oAPI, oReg, SourceId, WebLogicClassGuid, ManagedEntityId, TargetComputer, WebLogicVersionFilter

Set oArgs = WScript.Arguments
if oArgs.Count &lt; 3 Then
Wscript.Quit -1
End If

SourceId = oArgs(0)
ManagedEntityId = oArgs(1)
WebLogicClassGuid = oArgs(2)
TargetComputer = oArgs(3)
WebLogicVersionFilter = "12cR1"

Set oAPI = CreateObject("MOM.ScriptAPI")
Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
ReturnWebLogicInstallations oAPI, oReg, SourceId, ManagedEntityId, WebLogicClassGuid, TargetComputer, WebLogicVersionFilter
</Script></ScriptBody>
<TimeoutSeconds>300</TimeoutSeconds>
</DataSource>
</Discovery>