Has anyone been successful with creating script based discovery using MPAuthor?
I have created a very basic discovery script in PowerShell following the logic provided by Brian Wren in his training videos. It looks for a few folders in a directory and adds the name and path as property values.
The script executes without error on natively in Powershell and returns the desired properties within the XML generated. The agent will also execute the workflow without error after the management pack has been imported.
My issue is that nothing is discovered and the management server generates an error when it receives the discovery data from the agent in the operations manager event log:
Microsoft.EnterpriseManagement.Common.DiscoveryDataInvalidClassPropertyValueException,The class property value specified in the discovery data item is not valid. The value needs to adhere to the class.
Class property name: MPElement[Name=’MPAuthor.Classname’]/FolderPath$
Class property value: C:\foldername\childfolder
If I’m being honest I don’t really understand what this error means and google, so far hasn’t returned anything helpful.
Any help would be appreciated.
I had a typo in my discovery script, that’s all it was. I used the word principle instead of principal.
It looks like SCOM is expecting “FolderPath” to be something other than a string (for example, maybe it’s expecting a number), so the value of “C:\foldername\childfolder” is not valid.
In MPAuthor, you specify the property types when you create the discovery, like this string property:
Once you have created the discovery, you can check the property types by browsing to Targets, choosing the appropriate class and then viewing the XML. Here the XML confirms that it is a string:
Try checking the FolderPath property of your class and confirm that its type is set to be a string.
Can you show the XML of the class type you’ve defined?