<?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: LDAPsearch - How do I show members of a group, along with each members sAMAccountName field (not included in ldapgroup command)? in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/LDAPsearch-How-do-I-show-members-of-a-group-along-with-each/m-p/183127#M18177</link>
    <description>&lt;P&gt;I'll admit I haven't used SA-ldapsearch yet, but according to &lt;A href="http://docs.splunk.com/Documentation/SA-LdapSearch/latest/User/Theldapgroupcommand"&gt;its docs at least&lt;/A&gt; the sAMAccountName should be the member_name field in the output of the ldapgroup command?&lt;/P&gt;</description>
    <pubDate>Tue, 13 Jan 2015 19:51:55 GMT</pubDate>
    <dc:creator>acharlieh</dc:creator>
    <dc:date>2015-01-13T19:51:55Z</dc:date>
    <item>
      <title>LDAPsearch - How do I show members of a group, along with each members sAMAccountName field (not included in ldapgroup command)?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/LDAPsearch-How-do-I-show-members-of-a-group-along-with-each/m-p/183126#M18176</link>
      <description>&lt;P&gt;How do I run a search using ldapsearch which shows all members of a group, along with each member's sAMAccountName?&lt;/P&gt;

&lt;P&gt;Currently, using LDAPGROUP (as shown below), we are only able to receive the basic CN for each member. However, I want to see the sAMAccount name for each user. &lt;/P&gt;

&lt;P&gt;Anybody know how?&lt;/P&gt;

&lt;P&gt;Search: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| ldapsearch domain="default" search="(&amp;amp;(objectClass=group)(cn=my_group))" | ldapgroup
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Results show members of the group as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;CN=Doe John,OU=MyGroups,OU=Americas,OU=company,DC=ad,DC=company,DC=net 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need to see a field for sAMAccountName also, for example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;DoeJo
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or something similar to that sAMAccountName.&lt;/P&gt;

&lt;P&gt;Anyone got any ideas?!&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jan 2015 19:09:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/LDAPsearch-How-do-I-show-members-of-a-group-along-with-each/m-p/183126#M18176</guid>
      <dc:creator>jdunlea</dc:creator>
      <dc:date>2015-01-13T19:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: LDAPsearch - How do I show members of a group, along with each members sAMAccountName field (not included in ldapgroup command)?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/LDAPsearch-How-do-I-show-members-of-a-group-along-with-each/m-p/183127#M18177</link>
      <description>&lt;P&gt;I'll admit I haven't used SA-ldapsearch yet, but according to &lt;A href="http://docs.splunk.com/Documentation/SA-LdapSearch/latest/User/Theldapgroupcommand"&gt;its docs at least&lt;/A&gt; the sAMAccountName should be the member_name field in the output of the ldapgroup command?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jan 2015 19:51:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/LDAPsearch-How-do-I-show-members-of-a-group-along-with-each/m-p/183127#M18177</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2015-01-13T19:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: LDAPsearch - How do I show members of a group, along with each members sAMAccountName field (not included in ldapgroup command)?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/LDAPsearch-How-do-I-show-members-of-a-group-along-with-each/m-p/183128#M18178</link>
      <description>&lt;P&gt;A few ways I could think of doing it. &lt;/P&gt;

&lt;P&gt;If you have the commonname of the group:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| ldapsearch domain="&amp;lt;domain&amp;gt;" search=(&amp;amp;(objectClass=group)(cn=&amp;lt;groupCommonName&amp;gt;)) attrs="member"
| mvexpand member
| ldapfilter domain="&amp;lt;domain&amp;gt;" search=(&amp;amp;(objectClass=user)(distinguishedName="$member$")) attrs="sAMAccountName"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The easiest but least efficient way if you have the distinguished name for the group (Warning, this may cause excessive load on AD, Thanks Andy!):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| ldapsearch domain="&amp;lt;domain&amp;gt;" search=(&amp;amp;(objectClass=user)(memberOf="&amp;lt;GroupDN&amp;gt;")) attrs=sAMAccountName
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Jan 2015 23:44:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/LDAPsearch-How-do-I-show-members-of-a-group-along-with-each/m-p/183128#M18178</guid>
      <dc:creator>mbenwell</dc:creator>
      <dc:date>2015-01-13T23:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: LDAPsearch - How do I show members of a group, along with each members sAMAccountName field (not included in ldapgroup command)?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/LDAPsearch-How-do-I-show-members-of-a-group-along-with-each/m-p/183129#M18179</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;We helped user jdunlea fix his problem.&lt;/P&gt;

&lt;P&gt;It turns out that, in his example, the group he was referencing was in a parent domain and the users were in child domains. This was confusing SA-LDAPsearch because while it does follow referrals, it does not follow continuation referrals (referrals where AD says the member data is on another server.)&lt;/P&gt;

&lt;P&gt;The way to fix the problem is to have SA-LDAPsearch use the global catalog port (port 3268/3269). Once he queried on that port, the member data populated as desired.&lt;/P&gt;

&lt;P&gt;I will be adding this note to a "best practices" page in the documentation.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jan 2015 20:44:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/LDAPsearch-How-do-I-show-members-of-a-group-along-with-each/m-p/183129#M18179</guid>
      <dc:creator>malmoore</dc:creator>
      <dc:date>2015-01-14T20:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: LDAPsearch - How do I show members of a group, along with each members sAMAccountName field (not included in ldapgroup command)?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/LDAPsearch-How-do-I-show-members-of-a-group-along-with-each/m-p/183130#M18180</link>
      <description>&lt;P&gt;I'd recommend against using memberOf for your search.  You'll be pulling every account on your domain and churning through the group memberships.  You're basically pulling every single account on your domain.  The Active Directory team at your site will likely be extremely upset.&lt;/P&gt;

&lt;P&gt;That second search seems to be preferred by the Active Directory admins I've talked to.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2016 15:03:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/LDAPsearch-How-do-I-show-members-of-a-group-along-with-each/m-p/183130#M18180</guid>
      <dc:creator>AndySplunks</dc:creator>
      <dc:date>2016-03-17T15:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: LDAPsearch - How do I show members of a group, along with each members sAMAccountName field (not included in ldapgroup command)?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/LDAPsearch-How-do-I-show-members-of-a-group-along-with-each/m-p/183131#M18181</link>
      <description>&lt;P&gt;Thanks for that Andy! I've edited my answer.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2016 21:39:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/LDAPsearch-How-do-I-show-members-of-a-group-along-with-each/m-p/183131#M18181</guid>
      <dc:creator>mbenwell</dc:creator>
      <dc:date>2016-03-17T21:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: LDAPsearch - How do I show members of a group, along with each members sAMAccountName field (not included in ldapgroup command)?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/LDAPsearch-How-do-I-show-members-of-a-group-along-with-each/m-p/183132#M18182</link>
      <description>&lt;P&gt;| ldapsearch domain="default" search="(&amp;amp;(objectClass=group)(cn=my_group))" &lt;BR /&gt;
| ldapgroup&lt;BR /&gt;
| table cn,member_dn,member_type,member_name&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:07:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/LDAPsearch-How-do-I-show-members-of-a-group-along-with-each/m-p/183132#M18182</guid>
      <dc:creator>cblanton</dc:creator>
      <dc:date>2020-09-30T00:07:40Z</dc:date>
    </item>
  </channel>
</rss>

