Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > List domains on a windows network?

Reply
Thread Tools

List domains on a windows network?

 
 
Jason
Guest
Posts: n/a
 
      09-09-2004
Hi,

I'm looking for a way to enumerate the domains within my network. I
can find functions within the win32net library to enumerate computers
within a given domain, but is there a way I can get a list of the
domains themselves?

Thanks,
Jason
 
Reply With Quote
 
 
 
 
Tim Golden
Guest
Posts: n/a
 
      09-14-2004
http://www.velocityreviews.com/forums/(E-Mail Removed) (Jason) wrote in message news:<(E-Mail Removed). com>...
> Hi,
>
> I'm looking for a way to enumerate the domains within my network. I
> can find functions within the win32net library to enumerate computers
> within a given domain, but is there a way I can get a list of the
> domains themselves?
>
> Thanks,
> Jason


You've probably found this out by now, but the following
code should do the business:

<code>

import win32com.client

for domain in win32com.client.GetObject ("WinNT:"):
print domain.Name

</code>

TJG
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A List of 1000+ Domains Owned by Google Silverstrand Media 12 05-28-2010 12:48 PM
domains, top level, collecting a list of wardbayern@yahoo.com Perl Misc 1 01-29-2008 11:34 PM
list sub-domains? steven NZ Computing 1 03-24-2005 03:44 AM
RE: List domains on a windows network? Tim Golden Python 0 09-09-2004 08:10 AM
How do you get a list of the computers and domains on your network WWallace ASP .Net 0 10-22-2003 11:49 PM



Advertisments