473,756 Members | 6,852 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting user's domain name

I'm having some strange problems with a VB.NET application that I support.
The application currently uses SystemInformati on.UserName() and
SystemInformati on.UserDomainNa me() 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 SystemInformati on.UserDomainNa me()
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 13479
you might try

System.Environm ent.UserDomainN ame

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 SystemInformati on.UserName() and
SystemInformati on.UserDomainNa me() 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 SystemInformati on.UserDomainNa me()
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.Environm ent.UserDomainN ame

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 SystemInformati on.UserName() and
SystemInformati on.UserDomainNa me() 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 SystemInformati on.UserDomainNa me()
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.Use rDomainName?

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

"M. Posseth" <MP******@discu ssions.microsof t.com> wrote in message
news:FB******** *************** ***********@mic rosoft.com...
you might try

System.Environm ent.UserDomainN ame

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 SystemInformati on.UserName() and
SystemInformati on.UserDomainNa me() 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 SystemInformati on.UserDomainNa me()
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.Environm ent.UserDomainN ame, and it returned nothing (which is the
same as System.Environm ent.UserName did as well).
-Scott

"M. Posseth" <MP******@discu ssions.microsof t.com> wrote in message
news:FB******** *************** ***********@mic rosoft.com...
you might try

System.Environm ent.UserDomainN ame

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 SystemInformati on.UserName() and
SystemInformati on.UserDomainNa me() 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 SystemInformati on.UserDomainNa me()
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.Environm ent.UserDomainN ame seems to be
returning exactly the same as Environment.Use rDomainName.
-Scott
"M. Posseth" <MP******@discu ssions.microsof t.com> wrote in message
news:FB******** *************** ***********@mic rosoft.com...
you might try

System.Environm ent.UserDomainN ame

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 SystemInformati on.UserName() and
SystemInformati on.UserDomainNa me() 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 SystemInformati on.UserDomainNa me()
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 SystemInformati on.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.Use rDomainName?

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

"M. Posseth" <MP******@discu ssions.microsof t.com> wrote in message
news:FB******** *************** ***********@mic rosoft.com...
you might try

System.Environm ent.UserDomainN ame

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 SystemInformati on.UserName() and
SystemInformati on.UserDomainNa me() 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 SystemInformati on.UserDomainNa me()
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
1477
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 the desktop client polls a webservice to return info to the user. The client wants to only manage accounts via the AD. So if they create a new AD user then the app should automatically create a user in the app database. This is not such a problem...
4
2948
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 which user account my appliation is running. If the system is not a part of domain controller then i should check for the user name in the current stystem users list. Can any one give me an example to solve my problem? I need C# sample code for...
11
4863
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 name that is found on the Workstation Locked screen between the ( )'s. Does anyone know how to do that? The only constraint: no use of ActiveDS.dll permitted by the design. Many thanks! Derek
5
2069
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 access if they are members of a certain group on the server. When the application is deployed, the group will be a domain group, but for our developers the group is a local group on the development machines. To check the group membership, I am...
2
2417
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 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.
3
10926
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 to be able to use supplied credentials with System.IO versus using default credentials that app is running under. So far I am forced to use WMI which is less convenient and slower then System.IO, but it's providing me with "Connection Options"
4
5691
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 *************************************************************************************************** DirectoryEntry AD = new DirectoryEntry("WinNT://" + sServerName + ",Computer",UserName,Password); DirectoryEntry admGroup = AD.Children.Find("Administrators", "Group"); object members = admGroup.Invoke("Members", null); ...
5
13210
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 Properties collection I can't get the properties on some users. For example, I get all the users that are part of my machines Administrators Group. I get get the properties of the built in local Administrator account and some local IT account,...
1
2616
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 User</name> <email>myuser@domain.com</email> <manager>manager@domain.com</manager>
1
1776
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. domain user name). actually once i run exe file the generated file name is according to user itself for eg if "xyz" is a domain user who logged into domain and if he access the php script (remember php script is calling exe file) the final...
0
9384
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9212
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9973
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9779
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8645
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6473
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5069
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2612
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.