Figure out domain of system?

  • Thread starter Thread starter Smokey Grindel
  • Start date Start date
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!
 
¤ 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)
 
Back
Top