|
|
|
date: 10 Nov 2005 07:42:24 -0800,
group: microsoft.public.platformsdk.active.directory
back
How can i search multiple computers outside domain
Hi,
Can any one help me please ,i am new to this active directory and LDAP
and WMI, my question is, how can i do a directory searching for
different computers, say,i am in "MYdomain" but i want to search
standalone computers which are not part of any domain.
i am writing in c# windows application, for eg:Say i am in one domain
called "mydomain", i can find all computers in that domain ,but if i
want to search this domain computers as well as stand alone computers
which are not part of any domain, then how do i search them.
below is the sample code
string rootDSE= <LDAP:\\DC="Mydomain",DC="Com"/>
System.DirectoryServices.DirectorySearcher DSESearcher=new
System.DirectoryServices.DirectorySearcher();
entry=new DirectoryEntry(rootDSE);
search = new DirectorySearcher(entry);
search.Filter="(&"+_ldapFilter+")";
search.SearchScope=SearchScope.Subtree;
results = search.FindAll();
I tried <LDAP:\\DC="worstation1",DC="MYDomain",DC="COM"/>
i get a error saying "a referral was returned from the server", can
anyone give a feed back what i am doing wrong.and can anyone show me
steps,its greatly appreciated.
thanks in advance
date: 10 Nov 2005 07:42:24 -0800
author: mpl
Re: How can i search multiple computers outside domain
AD has no knowledge of computers that aren't in the forest. You have a couple of
options
1. Scan the browse lists. Look at MSDN for browse list functions. You will
probably have to pinvoke all of them.
2. Scan the network ip by ip looking for machines that respond and then sending
various NET * calls at them. Again, you will probably be doing a lot of pinvoke.
joe
mpl wrote:
> Hi,
>
> Can any one help me please ,i am new to this active directory and LDAP
> and WMI, my question is, how can i do a directory searching for
> different computers, say,i am in "MYdomain" but i want to search
> standalone computers which are not part of any domain.
>
> i am writing in c# windows application, for eg:Say i am in one domain
> called "mydomain", i can find all computers in that domain ,but if i
> want to search this domain computers as well as stand alone computers
> which are not part of any domain, then how do i search them.
>
> below is the sample code
>
>
> string rootDSE= <LDAP:\\DC="Mydomain",DC="Com"/>
> System.DirectoryServices.DirectorySearcher DSESearcher=new
> System.DirectoryServices.DirectorySearcher();
> entry=new DirectoryEntry(rootDSE);
> search = new DirectorySearcher(entry);
> search.Filter="(&"+_ldapFilter+")";
> search.SearchScope=SearchScope.Subtree;
> results = search.FindAll();
>
> I tried <LDAP:\\DC="worstation1",DC="MYDomain",DC="COM"/>
>
> i get a error saying "a referral was returned from the server", can
> anyone give a feed back what i am doing wrong.and can anyone show me
> steps,its greatly appreciated.
>
> thanks in advance
>
date: Thu, 10 Nov 2005 18:21:06 -0500
author: Joe Richards [MVP]
|
|