473,547 Members | 2,290 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

List domains on a windows network?

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
Jul 18 '05 #1
1 2854
ja************@ hotmail.com (Jason) wrote in message news:<ed******* *************** ****@posting.go ogle.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
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1265
by: Aws | last post by:
Hi Friends How to programmatically read The Names of a Network Domains, The Number and Names of the Workstations Connected to a specific Domain! I am using the WMI in VS.NET, and want to know how to read all the network domains available in my network. Would be also nice to be able to read all the WorkStation connected (physical...
1
2464
by: Piotrek Stachowicz | last post by:
Hi, I'd like to display list of all MS SQL servers which are available on the network (I write application which uses database located on one of the machines in my LAN). Has anyone got any idea what to do in order to obtain list of all such servers?! When you open Sql Service Manager (for sql server2000) you've got such list. Thanks,
0
1004
by: Jan Wrage | last post by:
Hi! Currently i'm working on a program that should let u administer every domain on the network. First step is to enumerate all domains with DirectoryEntry("WinNT:") That takes a long time but works. Next step is to determine the types of the domains, i.e. is it a NT4 or an
0
993
by: Director - M.invent | last post by:
Hi, I need to mimic the 'Entire Network' option of the Windows Explorer... I have tried LDAP with AD and other similar bits and bobs but they all need a domain name to be specified and only return domains and respective members of that domain... What i need is the ability to see ALL of the domains AND workgroups on a network.
4
3597
by: Alexander Cohen | last post by:
How can i get list of all domains available? thanks! -- Alexander Cohen http://www.toomuchspace.com (819) 348-9237 (819) 432-3443
1
3585
by: gnusmsa | last post by:
ASP.NET 2.0 (C#) application Using Windows authentication and impersonation Windows Server 2003 (IIS6) Server is a member server on a domain Logged into server as a domain user that is in the local Administrators group on the server Workstation is on the same domain Logged into the workstation as the same domain user, which is also in the...
18
2442
by: Vic Spainhower | last post by:
Hello, Can someone tell me why on some computers the following list will fail . I have a user reported that some of the links in the below list will fail and some will work. The ones that fail will have the www missing in the URL. For example when this particular computer will have the link as http://mysite.com/entry_page.php instead of...
4
3279
by: viniiya | last post by:
Hi All, How to Create list of Server/Domains and its User Names from the Network using C#? I tried with Netuserenum and I got only User Names for server but not Domain users. Code I used: NetUserEnum(ServerName, 0, 2, out bufPtr, -1, out EntriesRead, out TotalEntries, out Resume); if (EntriesRead > 0)
0
875
by: Brian | last post by:
Hi, when connected to the network and using dns or enviorment i can find the Host name or domainname... but I would like to find all domains controls on a network and if possible list the ones that have a active directory .. but then if the domain controller can't be found.. get the local computer name. Kind of like the windows log in...
0
7507
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7698
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7947
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7461
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6030
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5361
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5080
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3492
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
747
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.