Yesterday I was modifying the Schema configuration on a Granfeldt PowerShell Management Agent on a Microsoft Identity Manager 2016 SP1 Server.
I was changing the Anchor attribute for a different attribute and on attempting to refresh the schema or view the configuration I got the following error;
Unable to retrieve schema. Error: Exception from HRESULT 0x80231343
I knew I’d seen this before, but nothing was jumping to mind. And this was a particular large Schema script.
After some debugging I realized it was because the attribute I had changed the Anchor attribute too, was also listed in the Schema script. It wasn’t obvious as the attribute entry was multiple pages deep in the script.
Essentially if you are seeing the error Unable to retrieve schema. Error: Exception from HRESULT 0x80231343 there are two likely causes;
- you haven’t declared an Object Class e.g User
- $obj | Add-Member -Type NoteProperty -Name “objectClass|String” -Value “User”
- the attribute you have as your anchor is also listed as an attribute in the schema script e.g
- $obj | Add-Member -Type NoteProperty -Name “Anchor-ObjectId|String” -Value “333a7e07-e321-42ea-b0a5-820598f2adee”
- $obj | Add-Member -Type NoteProperty -Name “ObjectId|String” -Value “333a7e07-e321-42ea-b0a5-820598f2adee”
- you don’t need this entry, just the Anchor entry
Hopefully this helps me quickly find the reason next time I make a simple mistake like this in the Schema script.