<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Hey, Scripting Guy! How Can I Get a List of Active Directory Groups That Have Just 1 Member or Fewer?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2008/03/18/how-can-i-get-a-list-of-active-directory-groups-that-have-just-1-member-or-fewer.aspx</link><description>Hey, Scripting Guy! We&amp;rsquo;re trying to straighten out our Active Directory, and in order to do so, I&amp;rsquo;ve been asked to come up with a list of all the groups that have just 1 member or fewer. How can I write a script that will return this information</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Hey, Scripting Guy! How Can I Get a List of Active Directory Groups That Have Just 1 Member or Fewer?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2008/03/18/how-can-i-get-a-list-of-active-directory-groups-that-have-just-1-member-or-fewer.aspx#3570994</link><pubDate>Mon, 06 May 2013 18:51:07 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3570994</guid><dc:creator>XIIxOveR</dc:creator><description>&lt;p&gt;If the value of objGroup.member is empty (i.e. group has 0 members) the following loop will error as it is not a collection:&lt;/p&gt;
&lt;p&gt;For Each strUser in objGroup.Member&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;i = i + 1&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;If i &amp;gt; 1 Then&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Exit For&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;End If&lt;/p&gt;
&lt;p&gt;Next&lt;/p&gt;
&lt;p&gt;You have to accomodate for the possibility of the collection being empty.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3570994" width="1" height="1"&gt;</description></item><item><title>re: Hey, Scripting Guy! How Can I Get a List of Active Directory Groups That Have Just 1 Member or Fewer?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2008/03/18/how-can-i-get-a-list-of-active-directory-groups-that-have-just-1-member-or-fewer.aspx#3450591</link><pubDate>Thu, 01 Sep 2011 11:03:09 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3450591</guid><dc:creator>Ryan</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I also would like to get this to write to a file. Please can you explain how to change it so that it does. I&amp;#39;m a noob admin that is just started to learn how to run these scripts..&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3450591" width="1" height="1"&gt;</description></item><item><title>re: Hey, Scripting Guy! How Can I Get a List of Active Directory Groups That Have Just 1 Member or Fewer?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2008/03/18/how-can-i-get-a-list-of-active-directory-groups-that-have-just-1-member-or-fewer.aspx#3442468</link><pubDate>Tue, 19 Jul 2011 21:29:04 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3442468</guid><dc:creator>IamMred</dc:creator><description>&lt;p&gt;@Diddle You will need to change the following:&lt;/p&gt;
&lt;p&gt;Wscript.Echo objRecordSet.Fields(&amp;quot;Name&amp;quot;).Value &amp;amp; &amp;quot; -- &amp;quot; &amp;amp; i&lt;/p&gt;
&lt;p&gt;Portion of the script to write to a Word document. Use the Microsoft Word tags in the tag cloud to see how to do that, or check for scripts in the Script Repository (in related links portion). &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3442468" width="1" height="1"&gt;</description></item><item><title>re: Hey, Scripting Guy! How Can I Get a List of Active Directory Groups That Have Just 1 Member or Fewer?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2008/03/18/how-can-i-get-a-list-of-active-directory-groups-that-have-just-1-member-or-fewer.aspx#3442465</link><pubDate>Tue, 19 Jul 2011 21:18:32 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3442465</guid><dc:creator>Diddle</dc:creator><description>&lt;p&gt;Well, this was interesting.... not the okra part, but the code. Is there a way to make it write to a text document the group and the number of members in that group with a comma delimiter. It seems like it would be more effective? How would you do this?&lt;/p&gt;
&lt;p&gt;example&lt;/p&gt;
&lt;p&gt;swbanana,5&lt;/p&gt;
&lt;p&gt;swcheese,394&lt;/p&gt;
&lt;p&gt;ect.&lt;/p&gt;
&lt;p&gt;It would be really cool if you could change the above script to do this.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Diddle&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3442465" width="1" height="1"&gt;</description></item></channel></rss>