Retrieve Domain Name

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

Guest

Hello Friends

I have a big problem. I can't retrieve the domain name (example:
contoso.com) using visual basic.net language. I'm very appreciate if anyone
give me an example how can I solve this.
Im new on this language and and perhaps this is very easy for all of you :)

Thanks for help

Bruno R.
 
Bruno said:
I have a big problem. I can't retrieve the domain name (example:
contoso.com) using visual basic.net language.

Can you describe the scenario in more detail? What do you mean with
"retrieving a domain name"?
 
Hello

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
 
¤ Hello Friends
¤
¤ I have a big problem. I can't retrieve the domain name (example:
¤ contoso.com) using visual basic.net language. I'm very appreciate if anyone
¤ give me an example how can I solve this.
¤ Im new on this language and and perhaps this is very easy for all of you :)

Try the following:

Dim SystemInfo As Object

SystemInfo = CreateObject("ADSystemInfo")
MsgBox(SystemInfo.ForestDNSName)


Paul
~~~~
Microsoft MVP (Visual Basic)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top