Re: How can I get list of computers in a domain?

From: William DePalo [MVP VC++] (willd.no.spam_at_mvps.org)
Date: 06/30/04


Date: Tue, 29 Jun 2004 23:51:42 -0400


"Peter Steele" <psteele@z-force.com> wrote in message
news:eq$QOhiXEHA.312@TK2MSFTNGP12.phx.gbl...
> I've found some VB code to query a domain controller to return the list of
> all computers in that domain. The VB code is reasonably straightforward
(see
> below). How do I do the equivalent in C++? I've done a lot of searches and
> haven't come up with much useful information. Any pointers would be
> appreciated:

I'm not expert at either VB or Active Directory Services but that's what I
think your snippet is using. You may want to start reading here

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adsi/adsi/active_directory_service_interfaces_adsi.asp

and then perhaps find an Active Directory newsgroup for information on its
object model.

On the other hand if you are looking for an answer to the question in the
subject line then I'd suggest that you search the docs for NetServerEnum()
for the pre-AD way of enumerating the workstations in a domain.

Regards,
Will



Relevant Pages

  • Problems migrating AD PDC
    ... I am trying to migrate from an old W2K3 Active Directory domain controller ... Eventually I want to remove the old server from the network. ... Most of the computers have fixed IPs so DHCP isn't really an issue, ...
    (microsoft.public.windows.server.general)
  • Re: rebuilding the primary dc
    ... Your clients are not members of this domain, ... If this was the only DC, you will have to disjoin the client computers from ... reinstalled server and active directory named it what it ... During that time I forced another domain controller to be primary. ...
    (microsoft.public.win2000.active_directory)
  • Re: Active Directory on Exchange 2000
    ... only to see Users, Computers, Contacts, etc. ... check that the ADUC on your domain controller is indeed pointing to the ... > When I installed Exchange 2000, Active Directory for Users ...
    (microsoft.public.exchange2000.admin)
  • Re: Wrong Machine Role listed in Active Directory
    ... > We have a Windows Server 2003 based Active Directory with several ... > I have a strange effect in Active Directory Users and Computers: ... > reads "Workstation or Server" for most clients. ... > Interestingly enough some machines are listed as "Domain Controller", ...
    (microsoft.public.windows.server.active_directory)
  • RE: NTDS.dit file is currupt
    ... "microsoft" wrote:> We are currently facing a serious problem with one our client server. ... > After rebooting the machine in directory services restore mode, I had> followed the steps below; ntdsutil neither defrag Active Directory Database> nor repair. ... Restart the domain controller. ... Check the integrity of the Active Directory database. ...
    (microsoft.public.win2000.active_directory)

Quantcast