What is the correct way of detecting active directory object is belong to a group or user? Here is how I handle in C#:
foreach (SearchResult sr in src)
{
if (sr.Properties["objectclass"].Contains("person") && sr.Properties["objectclass"].Contains("user"))
{
// USER ?
}
if (sr.Properties["objectclass"].Contains("group"))
{
// GROUP ?
}
}