Computer property Organizational Unit is Empty

30 Oct

 

The problem:

 

For a show case I had to make a group based on the computer OU. I ‘m using SCOM 2016 and had installed only the basic out of the box MPs.

I noticed that the Organizational Unit property was empty. Hmm why ? do I miss a MP doing this ??


 

The investigation:

 

So first I searched for a discovery filling this property. It is internal id is named : Microsoft.SystemCenter.DiscoverWindowsComputerProperties

See here : https://systemcenter.wiki/?GetElement=Microsoft.SystemCenter.DiscoverWindowsComputerProperties&Type=Discovery&ManagementPack=Microsoft.SystemCenter.Internal&Version=7.0.8443.6

Next I had a look at the datasource and took out the PS script part.

See here : https://systemcenter.wiki/?GetElement=Microsoft.SystemCenter.WindowsComputerPropertyDiscovery&Type=DataSourceModuleType&ManagementPack=Microsoft.SystemCenter.Internal&Version=7.0.8443.6

I opened a ISE on that server and copied the script into the editor.

Changed the initial params as :

#param($SourceType, $SourceId, $ManagedEntityId, $ComputerIdentity)

 

$SourceType=0

$SourceId=
[guid]::newguid()

$ManagedEntityId
=
[guid]::newguid()

$ComputerIdentity=“SCOMADMIN11.contoso.com”

 

And executed the script. And I got a error indicating that the $computer was empty. Searched and i noticed that the $ADSISearcher.Filter  is incorrect so the computer object isn’t populated from LDAP.

 

it is  

$ADSISearcher.Filter = ‘(&(DNSHostName=’ + $strDNSComputerName + ‘)(Name=’ + $strNetBIOSComputerName + ‘)(objectClass=computer))’;

but should be 

$ADSISearcher.Filter = ‘(&(DNSHostName=’ + $strDNSComputerName + ‘)(Name=’ + $strNetBIOSComputerName + ‘)(objectClass=computer))’;
    

So it’s a bug 😉

Solution:

 

Till the responsible Microsoft team isn’t going to fix this you will have to make you own discovery workflow to fill this property.

Hope this helps

Happy SCOMMING.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: