John:
Thanks a lot for providing this piece of code. It really has helped me in fixing the ownership of the "orphan" objects.
I'd like to ask you for more help in something related to this issue: Changing the ownership of the offending objects has helped, but I still keep on getting error messages in the logs saying that "The specified GUID does not refer to a item (GUID: xxxx)"
I've seen that, although the ownership of the objects now is fixed, the objects keep references to the offending GUID in their security settings, granting permissions to the non-existing user/group represented by the GUID.
Can you help me in finding those references, and changing them to a valid GUID in the new environment?
As a detail that worries me, yesterday I imported a set of reports I found in the connect forum and, as I expected, the security information related to the user that shared these reports was also imported in my CMDB (which, of course, generated the "The specified GUID..." error entries in the log)
Thanks again:
Falquian