Archived Boards > Network Extenders

How to Determine Whether Group or User?

(1/2) > >>

keslaa:
I am trying to untangle or AD groups. My though was to use WinBatch to go through a group, read each member and if it is a user/computer account, record to a text file. If the member is a nested group, open that up and read through the members, performing the same function - write the user/computer account to a file or traverse the nested group.

I can get most of this but I am having trouble getting WinBatch to tell me whether an object is a user, a computer or a group. Basically, how do I query the object class?

td:
If you are interested in getting the the groups, nested groups and primary group for each user you can simply use the ADSI extender's dsGetUsersGrps function. You can find out more about the function in the Consolidated WIL Help file, if you have installed the extender.

To directly answer your question.  Once you have the full LDAP path to an object you can use the dsGetProperty to obtain its object class:


--- Code: Winbatch ---strClass = dsGetProperty(strAdsiPath,"objectClass")

keslaa:

--- Quote from: td on May 12, 2015, 06:40:11 am ---
To directly answer your question.  Once you have the full LDAP path to an object you can use the dsGetProperty to obtain its object class:


--- Code: Winbatch ---strClass = dsGetProperty(strAdsiPath,"objectClass")
--- End quote ---

That was it. Thank you! I was using "object class" instead of "objectclass".

Where can I get a list of these property names so I get the syntax correct going forward?

td:
You can use the extender's 'dsGetPropName' function to get a list of the property names associated with an object. 

keslaa:
Unbelievable. That's exactly what I was looking for but didn't see it until you told me. I don't know if it's age or exhaustion...

Thank you!

Navigation

[0] Message Index

[#] Next page

Go to full version