crazyboybert
Programmer
I posted this question to the msdn newsgroups but no one there has an answer for me :-( so hopefully a tek-tipper will ;-)
I am using DirectoryServices to find all the members of a
certain NT group and display their properties. The
following code works fine.
However if I use the same code and try to write out the
NativeGuid or Guid 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?
I've read soem stuff which suggest that I could need to explicitly rebind to the directory each time but this seems crazy. What I don't understand is why readingh Guid is any different from reading Name?
TIA for any light that can be shed on this one for me.
Cheers Rob
i'm a boy, called Bert, and I may not be crazy, but if i'm not the rest of you are...
I am using DirectoryServices to find all the members of a
certain NT group and display their properties. The
following code works fine.
Code:
DirectoryEntry directory = new DirectoryEntry("WinNT://"
+ Environment.MachineName + "/MyGroup");
object members = directory.Invoke("Members", null);
foreach(object member in (IEnumerable) members){
Console.WriteLine(member.Name);
}
NativeGuid or Guid 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?
I've read soem stuff which suggest that I could need to explicitly rebind to the directory each time but this seems crazy. What I don't understand is why readingh Guid is any different from reading Name?
TIA for any light that can be shed on this one for me.
Cheers Rob
i'm a boy, called Bert, and I may not be crazy, but if i'm not the rest of you are...