List domains on a windows network?

Discussion in 'Python' started by Jason, Sep 9, 2004.

  1. Jason

    Jason Guest

    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
    Jason, Sep 9, 2004
    #1
    1. Advertising

  2. Jason

    Tim Golden Guest

    (Jason) wrote in message news:<>...
    > 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
    Tim Golden, Sep 14, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. WWallace
    Replies:
    0
    Views:
    686
    WWallace
    Oct 23, 2003
  2. Tim Golden

    RE: List domains on a windows network?

    Tim Golden, Sep 9, 2004, in forum: Python
    Replies:
    0
    Views:
    598
    Tim Golden
    Sep 9, 2004
  3. Jacksm
    Replies:
    1
    Views:
    1,021
    =?Utf-8?B?TW9oYW1lZCBNb3NhbGVt?=
    Nov 13, 2006
  4. Dica
    Replies:
    0
    Views:
    414
  5. Replies:
    1
    Views:
    287
    John W. Krahn
    Jan 29, 2008
Loading...

Share This Page