Getting user's domain name

S

Scott M. Lyon

I'm having some strange problems with a VB.NET application that I support.


The application currently uses SystemInformation.UserName() and
SystemInformation.UserDomainName() to determine who is logged in, and what
network domain they are logged into.


And for our environment here (logged into a domain), it seems to work just
fine.


However, we have some German users (with a slightly different operating
system - basic Windows XP english vs Windows XP german with something called
the CAT client on it) that aren't getting the domain correctly, despite
being logged into the same domain as we are in the states.


When they run the application, it reports their domain as their computer
name, and not the domain.


I checked their system environment variables (manually, from a CMD window),
and even that confirmed that they were on the domain. But it's still not
reporting that to SystemInformation.UserDomainName()


I also tried the UserName/UserDomainName properties of the Environment
object, and got the same (incorrect) results.


Has anyone else dealt with anything like this? If so, what do I need to do
to get the correct domain?


Thanks!
-Scott
 
J

Jim Hughes

There is a reproducable bug in 1.1. I reported it and got confirmation. I
have not tested it under 2.0 yet.

If the current username exists in the local SAM, UserDomain reports the
computername even if the user is logged in using a domain account.

e.g. orgdomain\Scott logged in on Mycomputer will return domain Mycomputer
if a user account with the same name exists in both orgdomain and in
Mycomputer.
 

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