I would like to get all User Profiles where a specific user is manager (programmatically). Does anybody have an idea what's the best solution for that? It should work like in "My organization browser" and "My organization chart". E.g. I have an instance of user profile "Keaton, Dean" and I want to know from which users he is a manager.
If I search the UserProfileManager-Class and UserProfile-Class one way is to iterate threw all user profiles in user profile manager but I've read that this is not the best solution for performance reasons.
foreach(UserProfile up in upm)
{
if(up["Manager"]==manager)
...
}
If I use FullTextSQLQuery I can't get any results although I added the "Manager"-Property to the Metadata Properties and finished a full crawl.
Any help is appreciated! Thanks.