I have the code below that successfully gives all of the entries in a
local group. But if an entry is a global group, then those users are
not enumerated. How should I modify the code to dig into any global
groups as well?

Thanks.


using System;
using System.Collections;
using System.Runtime.InteropServices;
using System.DirectoryServices;
using ActiveDs;

.....

public string GroupMembers( string userId )
{
string returnVal = "!Default";
string locPath = "WinNT://" +
System.Environment.GetEnvironmentVariable("COMPUTE RNAME");

DirectoryEntry localGroup;
localGroup = new DirectoryEntry( locPath + "/LocalGroupTest,group" );

object allMembers = localGroup.Invoke("Members");
foreach (object groupMember in (IEnumerable)allMembers)
{
DirectoryEntry memberEntry = new DirectoryEntry(groupMember);
returnVal += memberEntry.Name + " : ";
}
return returnVal;
}




*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!