FAQ
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

Search Discussions

  • Tim Golden at Sep 9, 2004 at 8:10 am
    [jakasspinguino at hotmail.com]
    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?
    Just in case no-one knows the answer straight off...

    If you can present the answer from a Win32 perspective (eg by searching
    MSDN or tech articles and finding someone's non-Python solution) you're
    more likely to get some help from people who are conversant in Python
    with Win32 but who've never tackled this particular issue.

    I suspect the answer will involve Active Directory, assuming your
    setup uses it.

    TJG

    ________________________________________________________________________
    This e-mail has been scanned for all viruses by Star. The
    service is powered by MessageLabs. For more information on a proactive
    anti-virus service working around the clock, around the globe, visit:
    http://www.star.net.uk
    ________________________________________________________________________
  • Tim Golden at Sep 14, 2004 at 8:33 am
    jakasspinguino at hotmail.com (Jason) wrote in message news:<ed7f588b.0409081938.4634c05c at posting.google.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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedSep 9, '04 at 3:38a
activeSep 14, '04 at 8:33a
posts3
users2
websitepython.org

2 users in discussion

Tim Golden: 2 posts Jason: 1 post

People

Translate

site design / logo © 2022 Grokbase