Figure out domain of system?

S

Smokey Grindel

Is there any quick way to get the NT Domain of a system that is in a domain?
I already found the computer name in my.computer.name but dont see a quick
solution to the domain... anyone know of one? thanks!
 
P

Paul Clement

¤ Is there any quick way to get the NT Domain of a system that is in a domain?
¤ I already found the computer name in my.computer.name but dont see a quick
¤ solution to the domain... anyone know of one? thanks!

Don't know which format you're looking for but the following (which uses ADSI) is probably the
easiest method:

Dim SystemInfo As Object

SystemInfo = CreateObject("ADSystemInfo")
Console.WriteLine(SystemInfo.DomainShortName)
Console.WriteLine(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

Top