Hello,
I'm attempting to expand on an existing solution (that is working) to populate groups based on a CMDB query (http://blogs.technet.com/b/kevinholman/archive/2009/01/27/populating-groups-from-a-sql-server-cmdb-step-by-step.aspx?pi10475=2). I have this working for Windows Computer objects as described in Kevin Holman's post. I'm trying to expand it to also include non-Windows objects from the Microsoft.Unix.Library MP. So Windows and Linux objects would both dynamically populate in the group(s).
With the added code, the MP imports fine, however the Linux objects are not populating as well.
Here is a snippet of the vbscript I'm using in the MP. Besides adding in the extra logic in the discovery script, are there any other changes that would need to be made to include the Linux/Unix objects?
Thank you!
#######################################################
If Instr(oRS.Fields("OS"),"Linux") <> 0 Then
Set serverInstance = oDiscoveryData.CreateClassInstance("$MPElement[Name='Unix!Microsoft.Unix.Computer']$")
serverInstance.AddProperty "$MPElement[Name='Unix!Microsoft.Unix.Computer']/PrincipalName$",oRS2.Fields("Path")
Set relationshipInstance = oDiscoveryData.CreateRelationshipInstance("$MPElement[Name='GroupPopulation.MattiviTest1GroupContainsWindowsComputers']$")
relationshipInstance.Source = groupInstance
relationshipInstance.Target = serverInstance
oDiscoveryData.AddInstance relationshipInstance
Else
Set serverInstance = oDiscoveryData.CreateClassInstance("$MPElement[Name='Windows!Microsoft.Windows.Computer']$")
serverInstance.AddProperty "$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$",oRS2.Fields("Path")
Set relationshipInstance = oDiscoveryData.CreateRelationshipInstance("$MPElement[Name='GroupPopulation.MattiviTest1GroupContainsWindowsComputers']$")
relationshipInstance.Source = groupInstance
relationshipInstance.Target = serverInstance
oDiscoveryData.AddInstance relationshipInstance
End If
#############################################################