AD current user

B

Brian Henry

is there a way to use the directory service to get the current user logged
into active directory? thanks
 
T

Tom Williams

Hi Brian,
Since I don't use Active directory, I can't give you a very good answer.

"Security for Microsoft Visual Basic .Net", isbn: 0-7356-1919-0 talks about
getting the user's name and domain from WindowsIdentity.GetCurrent.Name and
using that name to search Active Directory for the roles that user belongs
to. I'm not sure what namespace that comes from, but the code example imports
System.DirectoryServices, System.Threading.Thread and
System.Security.Principal.

hth
Tom
 
B

Brian Henry

thanks that did it! and it works for more then just AD users, system users
also work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top