By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,543 Members | 2,169 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,543 IT Pros & Developers. It's quick & easy.

Getting user's domain name

P: n/a
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

Nov 21 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
you might try

System.Environment.UserDomainName

regards

m. posseth

"Scott M. Lyon" wrote:
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

Nov 21 '05 #2

P: n/a
you might try

System.Environment.UserDomainName

regards

Michel Posseth

"Scott M. Lyon" wrote:
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

Nov 21 '05 #3

P: n/a
Isn't that the same as Environment.UserDomainName?

I've tried Environment.UserDomainName, and it's giving me the same results.
-Scott

"M. Posseth" <MP******@discussions.microsoft.com> wrote in message
news:FB**********************************@microsof t.com...
you might try

System.Environment.UserDomainName

regards

Michel Posseth

"Scott M. Lyon" wrote:
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

Nov 21 '05 #4

P: n/a
Disregard my previous response. I just tried
System.Environment.UserDomainName, and it returned nothing (which is the
same as System.Environment.UserName did as well).
-Scott

"M. Posseth" <MP******@discussions.microsoft.com> wrote in message
news:FB**********************************@microsof t.com...
you might try

System.Environment.UserDomainName

regards

Michel Posseth

"Scott M. Lyon" wrote:
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

Nov 21 '05 #5

P: n/a
Okay, now I feel like an idiot. Ignore my last response (where it was
blank) - that was a coding issue.
But, as I suspected initially, System.Environment.UserDomainName seems to be
returning exactly the same as Environment.UserDomainName.
-Scott
"M. Posseth" <MP******@discussions.microsoft.com> wrote in message
news:FB**********************************@microsof t.com...
you might try

System.Environment.UserDomainName

regards

Michel Posseth

"Scott M. Lyon" wrote:
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

Nov 21 '05 #6

P: n/a
well i did not recognize the SystemInformation.UserName()
you mentioned
however :-)
http://forums.devx.com/showthread.php?t=145593

see Richard`s solution

regards

Michel Posseth
"Scott M. Lyon" wrote:
Isn't that the same as Environment.UserDomainName?

I've tried Environment.UserDomainName, and it's giving me the same results.
-Scott

"M. Posseth" <MP******@discussions.microsoft.com> wrote in message
news:FB**********************************@microsof t.com...
you might try

System.Environment.UserDomainName

regards

Michel Posseth

"Scott M. Lyon" wrote:
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


Nov 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.