Thread: Quest AD help
View Single Post
Old 09-11-2007   #5 (permalink)
Bob Landau


 
 

RE: Quest AD help

You are quite correct on both accounts

It is not hard; but I won't say that it's easy unless you are at least some
what acquainted with the .NET Directory Services classes.

The code I posted did not work I'm not sure why it didn't return an error
but thats an adventure for another day.

When I cut and pasted my code into the reply I missed the [ADSI] type so the
constructor never got constructed or should I say the [ADSI] ctor didn't.
What you got back was a STRING.

Add one very small change

$root = [ADSI] 'LDAP://OU=Enterprise, OU=NextGen DC=Continuum, DC=local'
$searcher = new-object System.DirectoryServices.DirectorySearcher($root)
$searcher.filter = "(&(objectClass=user)(cn=*Picard)"
$searcher.findall() | % {$_.path}

Again you must changes the moniker to reflect your DS namespace.

Here is one other URL which I found using MSN Live it's at the top of the
list and was one of the pages I used to learn about ADSI

http://www.microsoft.com/technet/tec...l/default.aspx

thx
bob

"Ian_1" wrote:
Quote:

> Sorry, your script doen't not work. I should not have been specific to just
> Quest. It can be WMI, or .NET, or utilizing the ADSI accelerator, etc, it
> really doesn't matter. Since this is the point of scripting to make life
> simple, surely it's as easy as ? (still researching)
My System SpecsSystem Spec