Sign in to follow this  
Followers 0
IanN1990

Extracting certain info out of AD [Closed]

2 posts in this topic

#1 ·  Posted (edited)

Hi All, 

I am running into some issues trying to extract a list of users, their job titles and departments from a list of  47 CN Groups.  

Here is what i have have tried so fair. 

$var = _AD_GetObjectsInOU("", "(object=G-XD*)", 2) 
This gives me an array of the 47 CN names. 
 

For $I = 1 to ubound($var)-1
    _Arraydisplay(_AD_GetGroupMembers($var[1]))
 Next

This give me a list of users in each group but it seams _GetGroupMembers returns Common Name.
Some Command Names are different from a users Account Name and this causes further extraction from _AD_GetObjectProperties() to fail. 

I tried using _AD_GetObjectsInOU() but cant get it work with CN.
 

;Idea 1
$SamName = _AD_SamAccountNameToFQDN("G-XD_VDI_Example")
_AD_GetObjectsInOU(SamName, "",  2, "name,title,department")

;Idea 2
_AD_GetObjectsInOU("", "(&(memberof=cn=G-XD_VDI_Example)(name=*))", 2, "name,title,department")


Does anyone have any ideas where to go from here? :)

Edited by IanN1990

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Closing. I was able to figure out the answer. I should of used the full path :)

_AD_GetObjectsInOU("", "(&(memberof=CN=G-XD_VDI_Example,OU=Example,OU=Example,OU=Example,OU=WIN7,DC=office,DC=local)(name=*))", 2, "name,title,department")

 

Edited by IanN1990

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  
Followers 0