Get the domain name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello friends

I need to create a simple application that returns the domain name where the
user name logs in. For example, if I acccess in a computer with the domain
user Contoso\bruno, my application should return the value "CONTOSO".
Basically, my application when executed in a pc that belongs to a domain,
must return the CONTOSO.COM (domain name). All this in Visual Basic.net.

Thank you for help
 
Bruno, this works fine for me

' Only works on NT or higher - not Win98,ME
If System.Environment.OSVersion.Platform = PlatformID.Win32NT Then
Diagnostics.Debug.WriteLine(System.Environment.UserDomainName())
End If

Dunno about the FQD name though

Bye,
Marius.
 
Thank You Marius for the help
but this return my user domain name, and I need my domain name like
contoso.com. Do you know how can I get this?
 
Back
Top