473,395 Members | 1,653 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Getting user's domain name

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
6 13436
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Buddy Ackerman | last post by:
I have an application where the client wants AD integration. The application requires that the user accounts reside in the app's database. The application is a (.NET) webservices based app where...
4
by: Saradhi | last post by:
Hi All, Can any one tell me the way to check whether a given user name is a member of domain users or not. I do not know the domain name as well. I should retreive from the logged in user, in...
11
by: Derek Martin | last post by:
Using VB.Net, I would like to retrieve the currently logged in user's DN from Active Directory. Alternatively, if, using WindowsIdentity, or something similar, I would like to get the user's full...
5
by: Ron L | last post by:
I have an application I am developing which is using remoting to have a smart client connect to a remote database via IIS. There are certain functions that we only want the user to be able to...
2
by: Scott M. Lyon | last post by:
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...
3
by: Dmitry | last post by:
I am trying to figure out how to pass set of credentials to System.IO Challenge is: App is running under one set of credentials, but via GUI user have a chance to enter another set. I would like...
4
by: shashank kadge | last post by:
hi all, i am trying to get local admin users and groups on a windows server. here is the C# code that i am using...
5
by: Michael Howes | last post by:
I'm writing a utility to manage a machines *local* accounts in c# I am getting all the users in a specific Group just fine but when I want to get some of the information on each user from their...
1
by: Chris White | last post by:
Here's my XML <?xml version="1.0" encoding="UTF-8"?> <results> <status code="ok"/> <report-bulk-users> <row principal-id="23859115" type="user"> <login>muser@domain.com</login> <name>My...
1
by: sbettadpur | last post by:
hello i am calling .exe file through my php script. i.e. using exec or system command, i am running exe file that exe file will create on txt file which contains who has logged into domain(i.e....
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.