Jump to content
Sign in to follow this  

Get all Computer from an "OU" with AD.au3

Recommended Posts


Hi, I'm trying to do something.

I want to get all computers présents in an OU of my domain ...

I use AD.au3 but i don't find the simple code to obtain that ?

exemple : from


I want to get


thanks for your help.

Share this post

Link to post
Share on other sites

Ok, i find, so i give you the code.

Thanks a lot :

Global $test = ""

                            Global $sOU = "OU=TEST,OU=RETEST,DC=domaine,DC=net"
                            Global $aResult = _AD_GetObjectsInOU($sOU, "(name=*)", 2,"sAMAccountName,distinguishedName,displayname")
                            For $i = 1  To $aResult[0][0]
                                $test = $test&$aResult[$i][0]
                            sleep (100)
MsgBox (0,"",$test)

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.