How to find the current user domain
-
Hi Can any one help me to find the current user domain. I am using the follwing code: WindowsIdentity wIdentity= WindowsIdentity.GetCurrent(); Its listing only the current system connected domain. For ex: I belongs to domain retail, if i log in using my userid and domain("retail") from other machine belongs to other domain, its giving that system domain instead of my domain. Help me please. kesavan
-
Hi Can any one help me to find the current user domain. I am using the follwing code: WindowsIdentity wIdentity= WindowsIdentity.GetCurrent(); Its listing only the current system connected domain. For ex: I belongs to domain retail, if i log in using my userid and domain("retail") from other machine belongs to other domain, its giving that system domain instead of my domain. Help me please. kesavan
What is this for? ASP.Net or something else? FOr ASP.Net the code you have there is correct, if it's giving you the wrong results then you probably don't have impersonation setup correctly. If it's for something else then check out the System.Environment[^] class.