<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Can I use the Splunk Supporting Add-on for Active Directory (SA-ldapsearch) to enumerate group membership for a spec in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-use-the-Splunk-Supporting-Add-on-for-Active-Directory-SA/m-p/511418#M86869</link>
    <description>&lt;P&gt;Yes, AD has &lt;SPAN&gt;a "magic string" (1.2.840.113556.1.4.1941) &lt;/SPAN&gt;that I go into more detail on this answer&amp;nbsp;&lt;A href="https://community.splunk.com/t5/All-Apps-and-Add-ons/How-can-I-flatten-nested-Active-Directory-group-members-for/m-p/422464/highlight/true#M51519" target="_blank" rel="noopener"&gt;https://community.splunk.com/t5/All-Apps-and-Add-ons/How-can-I-flatten-nested-Active-Directory-group-members-for/m-p/422464/highlight/true#M51519&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;But here is a working search for a single user that would give the output you mentioned:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| ldapsearch search="(&amp;amp;(objectClass=user)(!(objectClass=computer))(cn=username))" attrs="cn,memberOf"
| eval type="Direct"
| rename memberOf AS Group
| mvexpand Group
| append 
    [| ldapsearch search="(&amp;amp;(objectClass=group)(member:1.2.840.113556.1.4.1941:cn=username,dc=amr,dc=corp,dc=mydomain,dc=com))" attrs="cn"
    | rename dn AS Group
    | table Group 
    | eval type = "Nested"
    ]
| filldown cn
| stats values(type) AS type BY Group cn 
| rename cn AS User
| eval type = if(match(type,"Direct"),"Direct",type)
| table User Group type&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Jul 2020 21:29:22 GMT</pubDate>
    <dc:creator>worshamn</dc:creator>
    <dc:date>2020-07-28T21:29:22Z</dc:date>
    <item>
      <title>Can I use the Splunk Supporting Add-on for Active Directory (SA-ldapsearch) to enumerate group membership for a specified user?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-use-the-Splunk-Supporting-Add-on-for-Active-Directory-SA/m-p/385924#M69282</link>
      <description>&lt;P&gt;I have seen how the Splunk Supporting Add-on for Active Directory (SA-ldapsearch) can give me a list of all groups, and enumerate their membership, to include both nested and direct membership. I have also seen how I can retrieve all users, and the groups which they are a member of. &lt;/P&gt;

&lt;P&gt;Does anyone have a search where I can search Active Directory with SA-ldapsearch, specify a user, and enumerate all group membership, to include any inherited groups? &lt;/P&gt;

&lt;P&gt;Desired Results: &lt;BR /&gt;
User           | Group               |  Membership Type&lt;BR /&gt;
John.Doe  |  Domain Users |    Direct&lt;BR /&gt;
John.Doe  |  Accounting      |    Direct&lt;BR /&gt;
John.Doe  |  Finance Dept.   |  Nested&lt;/P&gt;

&lt;P&gt;I believe I had some success achieving this with the data from Active Directory monitoring - however, I'd prefer to use SA-ldapsearch for this. &lt;/P&gt;</description>
      <pubDate>Wed, 19 Sep 2018 13:09:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-I-use-the-Splunk-Supporting-Add-on-for-Active-Directory-SA/m-p/385924#M69282</guid>
      <dc:creator>danielansell</dc:creator>
      <dc:date>2018-09-19T13:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use the Splunk Supporting Add-on for Active Directory (SA-ldapsearch) to enumerate group membership for a spec</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-use-the-Splunk-Supporting-Add-on-for-Active-Directory-SA/m-p/511418#M86869</link>
      <description>&lt;P&gt;Yes, AD has &lt;SPAN&gt;a "magic string" (1.2.840.113556.1.4.1941) &lt;/SPAN&gt;that I go into more detail on this answer&amp;nbsp;&lt;A href="https://community.splunk.com/t5/All-Apps-and-Add-ons/How-can-I-flatten-nested-Active-Directory-group-members-for/m-p/422464/highlight/true#M51519" target="_blank" rel="noopener"&gt;https://community.splunk.com/t5/All-Apps-and-Add-ons/How-can-I-flatten-nested-Active-Directory-group-members-for/m-p/422464/highlight/true#M51519&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;But here is a working search for a single user that would give the output you mentioned:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| ldapsearch search="(&amp;amp;(objectClass=user)(!(objectClass=computer))(cn=username))" attrs="cn,memberOf"
| eval type="Direct"
| rename memberOf AS Group
| mvexpand Group
| append 
    [| ldapsearch search="(&amp;amp;(objectClass=group)(member:1.2.840.113556.1.4.1941:cn=username,dc=amr,dc=corp,dc=mydomain,dc=com))" attrs="cn"
    | rename dn AS Group
    | table Group 
    | eval type = "Nested"
    ]
| filldown cn
| stats values(type) AS type BY Group cn 
| rename cn AS User
| eval type = if(match(type,"Direct"),"Direct",type)
| table User Group type&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2020 21:29:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-I-use-the-Splunk-Supporting-Add-on-for-Active-Directory-SA/m-p/511418#M86869</guid>
      <dc:creator>worshamn</dc:creator>
      <dc:date>2020-07-28T21:29:22Z</dc:date>
    </item>
  </channel>
</rss>

