Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SystemInformation Problem

Status
Not open for further replies.

mdwg2020

Programmer
Feb 17, 2005
51
US
Hey guys,

Another question from me. In the beginning of my application I do the following check:

Code:
        'string to hold users logon
        Dim strUserName As String = SystemInformation.UserName

        If (Not SystemInformation.UserDomainName = "A70ADOM") Then
            MessageBox.Show("Application will now close. Please connect to the network and try again.", "Cannot Find Network Connection", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1)
            End
        End If

Whats happening is everyone is getting the MessageBox and the application is ending. I was with them when they logged into the domain, and we tried it several times, still getting the box.

Then I log them off, and logon, and it works fine for me. This happened on 2 different PCs. Any suggestions of what is going on. I'm sure I can just remove that portion of the application, but I just wanted to make sure they were logged into ADOM.

Where exactly does it get this information. It is the userdomain correct?
 
I beleive it gets it from AD. You may want to add some logging so that there is a history of domain\username. That would also tell you what domain they are logged in to. It's likely some minor issue like case or a \.

ie:
"A70ADOM" <> "a70adom"
"A70ADOM" <> "\\A70ADOM"
"A70ADOM" <> "A70ADOM\"
etc...

-Rick


----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Funny, I think I figured it out. What has happened is someone has also created those 2 users a local account. Somehow although they authenticate through ADOM, it is pulling the domain from that local account instead of the actual AD account. So instead of A70ADOM, which they are also logged into, it pulls bag the domain name, or in fact the actual PC name.

Under users and computers I see their ADOM accounts as well as a workstation account. The workstation account gives the domain as the workstation name.

What can you do? I just pulled out the check because it wasn't that important. The app truly doesn't need it.

Thanks,

Brooks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top