Security

How to use ldapfilter with ldapsearch to get group names?

kiran331
Builder

Hi

I'm running a ldapsearch for groups to get its members, but I need only the group objects excluding the user objects, I'm trying to to use sAMAccountType to differentiate the groups and users of the parent group but its not working, is there any alternative option?

ldap search i'm using:

|ldapsearch domain="abc" search=(&(objectClass=group)(cn=tt_users))|ldapgroup |table cn member_name|mvexpand member_namemember|ldapfilter search "cn=$member_name$ attrs"sAMAccountType"|search sAMAccountType="Group_Object"|table cn member_name sAMAccountType

0 Karma

BigCosta
Path Finder

Hi!
This code leave only group objects, excluding the user objects.

| ldapsearch search="(&(objectClass=group)(cn=tt_users))" attrs="cn,distinguishedName"
| ldapgroup
| table cn member_name
| mvexpand member_name
| ldapfilter search="(&(objectClass=group)(cn=$member_name$))" attrs="objectSid"

alemarzu
Motivator

Hi there @kiran331

Im not quite sure what you are trying to accomplish, can u elaborate further ?

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...