PC Review Forums Newsgroups Microsoft DotNet Microsoft VB .NET Figure out domain of system?

Reply

Figure out domain of system?

 
Thread Tools Rate Thread
Old 14-03-2007, 12:47 PM   #1
Smokey Grindel
Guest
 
Posts: n/a
Default Figure out domain of system?


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!


  Reply With Quote
Old 14-03-2007, 01:32 PM   #2
Paul Clement
Guest
 
Posts: n/a
Default Re: Figure out domain of system?

On Wed, 14 Mar 2007 08:47:51 -0400, "Smokey Grindel" <nospam@nospam.com> wrote:

¤ 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)
  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off