Hi
I am using DirectoryServices to find all the members of a
certain NT group and display their properties. The
following code works fine.
DirectoryEntry directory = new DirectoryEntry("WinNT://"
+ Environment.MachineName + "/MyGroup");
object members = directory.Invoke("Members", null);
foreach(object member in (IEnumerable) members){
Console.WriteLine(entry.Name);
}
However if I use the same code and try to write out the
NativeGuid property then for the first object alls well
and then on the second pass of the foreach loop I get the
following exception.
System.Runtime.InteropServices.COMException: Logon
failure: unknown user name or bad password.
Anyone know why?
Cheers Rob
Rob Williams - 08 Dec 2004 08:40 GMT
Ooops! The code below was supposed to read...
Console.WriteLine(member.Name);
Thanks in advance for any help anyone can provide on this.
I've read some posts with similar problems where a
suggestion has been made of explicitly rebinding to the
directory each pass but I don't understand why this
should make any difference and also don't want to have to
rebind for every member of the group.
Rob
>-----Original Message-----
>Hi
[quoted text clipped - 22 lines]
>Cheers Rob
>.