<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>vbscriptblog.com &#187; groups</title>
	<atom:link href="http://vbscriptblog.com/tag/groups/feed/" rel="self" type="application/rss+xml" />
	<link>http://vbscriptblog.com</link>
	<description>Scripting for Windows Sysadmins</description>
	<lastBuildDate>Mon, 16 Jan 2012 09:41:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Active Directory: VBscript to enumerate nested Active Directory groups from an Excel sheet</title>
		<link>http://vbscriptblog.com/vbscript/active-directory/groups/active-directory-vbscript-to-enumerate-nested-active-directory-groups-from-an-excel-sheet/</link>
		<comments>http://vbscriptblog.com/vbscript/active-directory/groups/active-directory-vbscript-to-enumerate-nested-active-directory-groups-from-an-excel-sheet/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 13:09:34 +0000</pubDate>
		<dc:creator>dirk adamsky</dc:creator>
				<category><![CDATA[groups]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[attribute]]></category>
		<category><![CDATA[command prompt]]></category>
		<category><![CDATA[cscript]]></category>
		<category><![CDATA[enumerate]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[user]]></category>
		<category><![CDATA[vb]]></category>
		<category><![CDATA[vbs]]></category>
		<category><![CDATA[vbscript]]></category>

		<guid isPermaLink="false">http://vbscriptblog.com/?p=1277</guid>
		<description><![CDATA[Haven&#8217;t done much scripting lately&#8230;.. The script for today is made for Ananth Kumar. He asked me to make an extension to the &#8220;enumerate nested groups script&#8221; so that multiple nested groups can be enumerated based on an input file. I did choose Excel for the input file so that i could reuse previous code. [...]]]></description>
			<content:encoded><![CDATA[<p>Haven&#8217;t done much scripting lately&#8230;..<br />
The script for today is made for Ananth Kumar.<br />
He asked me to make an extension to the <a href="http://vbscriptblog.com/vbscript/active-directory/groups/active-directory-vbscript-to-enumerate-the-members-of-nested-groups-v2/" title=""enumerate nested groups script"">&#8220;enumerate nested groups script&#8221;</a> so that multiple nested groups can be enumerated based on an input file.<br />
I did choose Excel for the input file so that i could reuse previous code.</p>
<p>Follow the next steps to run the script (no admin rights needed):</p>
<ul>
<li>find the distinguished names of the nested groups (adsiedit.msc)</li>
<li>put them in an Excel sheet in the first column ans save the sheet as c:\temp\groups.xls</li>
<li>open your favorite text editor</li>
<li>copy and paste the script below into the editor (you can use the icons in the upper rights corner of the code)</li>
<li>save the script (for example c:\temp\enumeratenestedgroupsfromexcelsheet.vbs)</li>
<li>open a command prompt</li>
<li>go to &#8220;c:\temp&#8221;</li>
<li>give &#8220;cscript enumeratenestedgroupsfromexcelsheet.vbs&#8221; (without quotes) and enter</li>
</ul>
<p>The script:</p>
<pre class="brush: vb; title: ; notranslate">
' Name : enumeratenestedgroupsfromexcelsheet.vbs
' Description : script to enumerate nested Active Directory groups from an Excel sheet
' Author : dirk adamsky - deludi bv
' Version : 1.0
' Date : 04-10-2011

Set objExcel = CreateObject(&quot;Excel.Application&quot;)
Set objWorkbook = objExcel.Workbooks.Open(&quot;C:\temp\groups.xls&quot;)
intRow = 2
Do Until objExcel.Cells(intRow,1).Value = &quot;&quot;
strGroupDN = objExcel.Cells(intRow, 1).Value
If strGroupDN &lt;&gt; &quot;&quot; Then
wscript.echo strGroupDN
EnumNestedgroup &quot;LDAP://&quot; &amp; strGroupDN
End If
intRow = intRow + 1
Loop
objExcel.Quit
Set objWorkbook = Nothing
Set objExcel = Nothing

Function EnumNestedgroup(strGroupDN)
Set objGroup = GetObject(strGroupDN)
For Each objMember in objGroup.Members
If (LCase(objMember.Class) = &quot;group&quot;) Then
EnumNestedgroup objMember.AdsPath
Else
Wscript.Echo objGroup.cn &amp; &quot; ; &quot; &amp; objMember.DisplayName &amp; &quot; ; &quot; &amp; objMember.Mail
End If
Next
Set objGroup = Nothing
End Function
</pre>
<p>When you have a modified version or problems/questions that you want to share please post it at the comments below.</p>
<p>Happy scripting.</p>
<p>Dirk Adamsky</p>
<div class="bottomcontainerBox" style="background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvbscriptblog.com%2Fvbscript%2Factive-directory%2Fgroups%2Factive-directory-vbscript-to-enumerate-nested-active-directory-groups-from-an-excel-sheet%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://vbscriptblog.com/vbscript/active-directory/groups/active-directory-vbscript-to-enumerate-nested-active-directory-groups-from-an-excel-sheet/"></g:plusone>
			</div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://vbscriptblog.com/vbscript/active-directory/groups/active-directory-vbscript-to-enumerate-nested-active-directory-groups-from-an-excel-sheet/"  data-text="Active Directory: VBscript to enumerate nested Active Directory groups from an Excel sheet" data-count="horizontal" data-via="dirkadamsky">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://vbscriptblog.com/vbscript/active-directory/groups/active-directory-vbscript-to-enumerate-nested-active-directory-groups-from-an-excel-sheet/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>]]></content:encoded>
			<wfw:commentRss>http://vbscriptblog.com/vbscript/active-directory/groups/active-directory-vbscript-to-enumerate-nested-active-directory-groups-from-an-excel-sheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VBscript: VBscript to enumerate all groups and their members from a specific Active Directory OU</title>
		<link>http://vbscriptblog.com/vbscript/active-directory/groups/vbscript-vbscript-to-enumerate-all-groups-and-their-members-from-a-specific-active-directory-ou/</link>
		<comments>http://vbscriptblog.com/vbscript/active-directory/groups/vbscript-vbscript-to-enumerate-all-groups-and-their-members-from-a-specific-active-directory-ou/#comments</comments>
		<pubDate>Wed, 01 Jun 2011 12:43:14 +0000</pubDate>
		<dc:creator>dirk adamsky</dc:creator>
				<category><![CDATA[groups]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[attribute]]></category>
		<category><![CDATA[command prompt]]></category>
		<category><![CDATA[cscript]]></category>
		<category><![CDATA[enumerate]]></category>
		<category><![CDATA[members]]></category>
		<category><![CDATA[memberships]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[recursion]]></category>
		<category><![CDATA[vb]]></category>
		<category><![CDATA[vbs]]></category>
		<category><![CDATA[vbscript]]></category>

		<guid isPermaLink="false">http://deludi.nl/blog/?p=1120</guid>
		<description><![CDATA[Today&#8217;s script is made for Tyrone. His question was a script that enumerates all groups and their members from a given OU. I already had a script that enumerates the members of an OU. I also had a script that enumerates the members of a nested group (uses recursion). The 2 scripts combined are the [...]]]></description>
			<content:encoded><![CDATA[<p>Today&#8217;s script is made for <a href="http://vbscriptblog.com/vbscript/active-directory/vbscript-to-enumerate-the-members-of-nested-groups/">Tyrone</a>.</p>
<p>His question was a script that enumerates all groups and their members from a given OU.<br />
I already had a script that enumerates the members of an OU.<br />
I also had a script that <a href="http://vbscriptblog.com/vbscript/active-directory/groups/active-directory-vbscript-to-enumerate-the-members-of-nested-groups-v2/">enumerates the members of a nested group</a> (uses <a href="http://en.wikipedia.org/wiki/Recursion">recursion</a>).<br />
The 2 scripts combined are the solution for Tyrone.</p>
<p>Follow the next steps to run the script (no admin rights needed):</p>
<p>* open your favorite text editor<br />
* copy and paste the script into the editor<br />
* change the OU distinguished name (in line 7) into your OU <a href="http://msdn.microsoft.com/en-us/library/aa366101%28v=vs.85%29.aspx">distinguished name</a><br />
* save the script (for example c:\temp\EnumerateGroupsInOu.vbs)<br />
* open a command prompt<br />
* go to &#8220;c:\temp&#8221;<br />
* give &#8220;cscript EnumerateGroupsInOu.vbs&#8221; (without quotes) and enter</p>
<p>You can also dump the output to a file:</p>
<p>* give &#8220;cscript EnumerateGroupsInOu.vbs > EnumerateGroupsInOu.txt&#8221; (without quotes) and enter</p>
<p>To get that file into Excel:</p>
<p>* open Excel<br />
* go to Menu=>Open File<br />
* change file type to &#8220;all&#8221;<br />
* chose EnumerateGroupsInOu.txt<br />
* chose &#8220;;&#8221; as separator character</p>
<p>The script:</p>
<pre class="brush: vb; title: ; notranslate">
' Name : EnumerateGroupsInOu.vbs
' Description : script to enumerate all groups and their members from a specific Active Directory OU
' Author : dirk adamsky - deludi bv
' Version : 1.00
' Date : 01-06-2011

Set objOU = GetObject(&quot;LDAP://OU=test,DC=test,DC=org&quot;)
	For Each objMember in objOU
		If (LCase(objMember.Class) = &quot;group&quot;) Then
			EnumNestedgroup objMember.AdsPath
		End If
	Next
Set objOU = Nothing

Function EnumNestedgroup(strGroupDN)
	Set objGroup = GetObject(strGroupDN)
	For Each objMember in objGroup.Members
		If (LCase(objMember.Class) = &quot;group&quot;) Then
			wscript.echo objMember.AdsPath
			EnumNestedgroup objMember.AdsPath
		Else
			Wscript.Echo objGroup.Name &amp; &quot; ; &quot; &amp; objMember.DisplayName &amp; &quot; ; &quot; &amp; objMember.Mail &amp;_
			&quot; ; &quot; &amp; objMember.Department &amp;  &quot; ; &quot; &amp;	objMember.Company &amp; &quot; ;  &quot; &amp; objMember.Title
		End If
	Next
	Set objGroup = Nothing
End Function
</pre>
<p>When you have problems/questions with the script please post a reply.</p>
<p>Happy scripting.</p>
<p>Best regards,</p>
<p>Dirk Adamsky</p>
<div class="bottomcontainerBox" style="background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvbscriptblog.com%2Fvbscript%2Factive-directory%2Fgroups%2Fvbscript-vbscript-to-enumerate-all-groups-and-their-members-from-a-specific-active-directory-ou%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://vbscriptblog.com/vbscript/active-directory/groups/vbscript-vbscript-to-enumerate-all-groups-and-their-members-from-a-specific-active-directory-ou/"></g:plusone>
			</div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://vbscriptblog.com/vbscript/active-directory/groups/vbscript-vbscript-to-enumerate-all-groups-and-their-members-from-a-specific-active-directory-ou/"  data-text="VBscript: VBscript to enumerate all groups and their members from a specific Active Directory OU" data-count="horizontal" data-via="dirkadamsky">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://vbscriptblog.com/vbscript/active-directory/groups/vbscript-vbscript-to-enumerate-all-groups-and-their-members-from-a-specific-active-directory-ou/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>]]></content:encoded>
			<wfw:commentRss>http://vbscriptblog.com/vbscript/active-directory/groups/vbscript-vbscript-to-enumerate-all-groups-and-their-members-from-a-specific-active-directory-ou/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Active Directory: VBscript to enumerate the message restrictions (send to rights) of a user or distributiongroup v2</title>
		<link>http://vbscriptblog.com/vbscript/active-directory/messagerestrictions/active-directory-vbscript-to-enumerate-the-message-restrictions-send-to-rights-of-a-user-or-distributiongroup/</link>
		<comments>http://vbscriptblog.com/vbscript/active-directory/messagerestrictions/active-directory-vbscript-to-enumerate-the-message-restrictions-send-to-rights-of-a-user-or-distributiongroup/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 12:08:01 +0000</pubDate>
		<dc:creator>dirk adamsky</dc:creator>
				<category><![CDATA[messagerestrictions]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[command prompt]]></category>
		<category><![CDATA[cscript]]></category>
		<category><![CDATA[distribution group]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[enumerate]]></category>
		<category><![CDATA[groups]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[memberships]]></category>
		<category><![CDATA[recursion]]></category>
		<category><![CDATA[smtp address]]></category>
		<category><![CDATA[user]]></category>
		<category><![CDATA[vb]]></category>
		<category><![CDATA[vbs]]></category>
		<category><![CDATA[vbscript]]></category>

		<guid isPermaLink="false">http://deludi.nl/blog/?p=684</guid>
		<description><![CDATA[Suffering from a lack of inspiration I decided to rework a previous script. I had a request on my previous messagerestriction script. Added to the script is the option to enter the smtp address of the user or group object for which the messagerestrictions are set. I have done that by re-using code from this [...]]]></description>
			<content:encoded><![CDATA[<p>Suffering from a lack of inspiration I decided to rework a previous script.<br />
I had a request on my previous <a href="http://deludi.nl/blog/vbscript/active-directory/messagerestrictions/active-directory-vbscript-to-enumerate-the-message-restrictions-send-to-rights-of-a-distributionlist/comment-page-1/#comment-104">messagerestriction script</a>.<br />
Added to the script is the option to enter the smtp address of<br />
the user or group object for which the messagerestrictions are set.<br />
I have done that by re-using code from <a href="http://deludi.nl/blog/vbscript/active-directory/active-directory-vbscript-to-change-the-groups-from-a-user-based-on-an-example-user/">this script</a>.<br />
Another question was the option to output to a file,<br />
this can be done easily by running the script like this:</p>
<p>cscript enumeratesendtorights.vbs > thefilenameofyourchoice.txt.</p>
<p>Follow the next steps to run the script (no admin rights needed):</p>
<p>* find the distinguished name of the nested group (adsiedit.msc)<br />
* open your favorite text editor<br />
* copy and paste the script into the editor<br />
* change the distinguished name<br />
* save the script (for example c:tempenumeratesendtorights.vbs)<br />
* open a command prompt<br />
* go to &#8220;c:temp&#8221;<br />
* give &#8220;cscript enumeratesendtorights.vbs&#8221; (without quotes) and enter</p>
<p>The script:</p>
<pre class="brush: vb; title: ; notranslate">
' Name : enumeratesendtorights.vbs
' Description : script to enumerate the message restrictions (send to rights) of a distributionlist
' Author : dirk adamsky - deludi bv
' Version : 2.00 added smtp input option based on input from M (see comments on previous script)
' Date : 20-08-2010 (v.1.00 date 08-02-2010)
' Level: advanced

strObject = InputBox(&quot;Please enter the smtp address&quot;)
Set objSource = GetObject(&quot;LDAP://&quot; &amp; GetDN(strObject))
If TypeName(objSource.authOrig) = &quot;String&quot; Then
	GetSendToRights (&quot;LDAP://&quot; &amp; objSource.authOrig)
Else
	For Each User In objSource.authOrig
		GetSendToRights (&quot;LDAP://&quot; &amp; User)
	Next
End If
If TypeName(objSource.dLMemSubmitPerms) = &quot;String&quot; Then
	EnumNestedgroup objSource.dLMemSubmitPerms
Else
	For Each Group in objSource.dLMemSubmitPerms
		EnumNestedgroup Group
	Next
End If
Set objSource = Nothing

Function GetDN(strMail)
	Set adoCommand = CreateObject(&quot;ADODB.Command&quot;)
	Set adoConnection = CreateObject(&quot;ADODB.Connection&quot;)
	adoConnection.Provider = &quot;ADsDSOObject&quot;
	adoConnection.Open &quot;Active Directory Provider&quot;
	adoCommand.ActiveConnection = adoConnection
	Set objRootDSE = GetObject(&quot;LDAP://RootDSE&quot;)
	strBase = &quot;&lt;LDAP://&quot; &amp; objRootDSE.Get(&quot;defaultNamingContext&quot;) &amp; &quot;&gt;&quot;

	' Filter on user objects.
	strFilter = &quot;(mail=&quot; &amp;  strMail &amp; &quot;)&quot;

	' Comma delimited list of attribute values to retrieve.
	strAttributes = &quot;distinguishedName&quot;

	' Construct the LDAP syntax query.
	strQuery = strBase &amp; &quot;;&quot; &amp; strFilter &amp; &quot;;&quot; &amp; strAttributes &amp; &quot;;subtree&quot;
	adoCommand.CommandText = strQuery
	adoCommand.Properties(&quot;Page Size&quot;) = 100
	adoCommand.Properties(&quot;Timeout&quot;) = 30
	adoCommand.Properties(&quot;Cache Results&quot;) = False
	Set adoRecordset = adoCommand.Execute
	wscript.echo adoRecordset.Fields(&quot;distinguishedName&quot;).Value
	GetDN = adoRecordset.Fields(&quot;distinguishedName&quot;).Value
	adoRecordset.Close
	adoConnection.Close

	Set adoRecordset = Nothing
	Set objRootDSE = Nothing
	Set adoConnection = Nothing
	Set adoCommand = Nothing

End Function

Function GetSendToRights(strUserDN)
	On Error Resume Next
	Set objAccount = GetObject(strUserDN)
	Wscript.Echo objAccount.Mail &amp; &quot; ; &quot; &amp; objAccount.DisplayName &amp; &quot; ; direct send to rights&quot;
	Set objSecurityDescriptor = objAccount.Get(&quot;ntSecurityDescriptor&quot;)
	Set objDacl = objSecurityDescriptor.DiscretionaryAcl
	Set objAce = CreateObject(&quot;AccessControlEntry&quot;)
	For Each objAce In objDacl
		If objAce.ObjectType = &quot;{AB721A54-1E2F-11D0-9819-00AA0040529B}&quot; Then
			If (Left(objAce.Trustee,3) &lt;&gt; &quot;S-1&quot; And objAce.Trustee &lt;&gt; &quot;NT AUTHORITYSELF&quot;) Then
				GetUserDetails Mid(objAce.Trustee,9)
			End If
		End If
	Next
End Function

Function GetUserDetails(strPreW2K)
	Set adoCommand = CreateObject(&quot;ADODB.Command&quot;)
	Set adoConnection = CreateObject(&quot;ADODB.Connection&quot;)
	adoConnection.Provider = &quot;ADsDSOObject&quot;
	adoConnection.Open &quot;Active Directory Provider&quot;
	adoCommand.ActiveConnection = adoConnection

	' Search entire Active Directory domain.
	Set objRootDSE = GetObject(&quot;LDAP://RootDSE&quot;)
	strDNSDomain = objRootDSE.Get(&quot;defaultNamingContext&quot;)
	strBase = &quot;&lt;LDAP://&quot; &amp; strDNSDomain &amp; &quot;&gt;&quot;

	' Filter on user objects.
	strFilter = &quot;(&amp;(objectCategory=person)(objectClass=user)(sAMAccountName=&quot; &amp;  strPreW2K &amp; &quot;))&quot;

	' Comma delimited list of attribute values to retrieve.
	strAttributes = &quot;mail, displayname&quot;

	' Construct the LDAP syntax query.
	strQuery = strBase &amp; &quot;;&quot; &amp; strFilter &amp; &quot;;&quot; &amp; strAttributes &amp; &quot;;subtree&quot;
	adoCommand.CommandText = strQuery
	adoCommand.Properties(&quot;Page Size&quot;) = 100
	adoCommand.Properties(&quot;Timeout&quot;) = 30
	adoCommand.Properties(&quot;Cache Results&quot;) = False

	' Run the query.
	Set adoRecordset = adoCommand.Execute
	Wscript.Echo adoRecordset.Fields(&quot;mail&quot;).Value &amp; &quot; ; &quot; &amp; adoRecordset.Fields(&quot;displayname&quot;).Value &amp; &quot; ; indirect send to rights&quot;
	' Clean up.
	adoRecordset.Close
	adoConnection.Close

	Set adoRecordset = Nothing
	Set objRootDSE = Nothing
	Set adoConnection = Nothing
	Set adoCommand = Nothing
End Function	

Sub EnumNestedgroup(strGroupDN)
	Set objGroup = GetObject(&quot;LDAP://&quot; &amp; strGroupDN)
	For Each objMember in objGroup.Members
		If (LCase(objMember.Class) = &quot;group&quot;) Then
			Call EnumNestedgroup(objMember.AdsPath)
		Else
			GetSendToRights objMember.AdsPath
		End If
	Next
	Set objGroup = Nothing
End Sub
</pre>
<p>When you have problems/questions with the script please post a reply.</p>
<p>Happy scripting.</p>
<p>Best regards,</p>
<p>Dirk Adamsky</p>
<div class="bottomcontainerBox" style="background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvbscriptblog.com%2Fvbscript%2Factive-directory%2Fmessagerestrictions%2Factive-directory-vbscript-to-enumerate-the-message-restrictions-send-to-rights-of-a-user-or-distributiongroup%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://vbscriptblog.com/vbscript/active-directory/messagerestrictions/active-directory-vbscript-to-enumerate-the-message-restrictions-send-to-rights-of-a-user-or-distributiongroup/"></g:plusone>
			</div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://vbscriptblog.com/vbscript/active-directory/messagerestrictions/active-directory-vbscript-to-enumerate-the-message-restrictions-send-to-rights-of-a-user-or-distributiongroup/"  data-text="Active Directory: VBscript to enumerate the message restrictions (send to rights) of a user or distributiongroup v2" data-count="horizontal" data-via="dirkadamsky">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://vbscriptblog.com/vbscript/active-directory/messagerestrictions/active-directory-vbscript-to-enumerate-the-message-restrictions-send-to-rights-of-a-user-or-distributiongroup/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>]]></content:encoded>
			<wfw:commentRss>http://vbscriptblog.com/vbscript/active-directory/messagerestrictions/active-directory-vbscript-to-enumerate-the-message-restrictions-send-to-rights-of-a-user-or-distributiongroup/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Active Directory: VBscript to enumerate all distribution groups that are hidden in the Global Address List</title>
		<link>http://vbscriptblog.com/vbscript/active-directory-vbscript-to-enumerate-all-distribution-groups-that-are-hidden-in-the-global-addres-list/</link>
		<comments>http://vbscriptblog.com/vbscript/active-directory-vbscript-to-enumerate-all-distribution-groups-that-are-hidden-in-the-global-addres-list/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 06:48:58 +0000</pubDate>
		<dc:creator>dirk adamsky</dc:creator>
				<category><![CDATA[active directory]]></category>
		<category><![CDATA[distributiongroups]]></category>
		<category><![CDATA[vbscript]]></category>
		<category><![CDATA[attribute]]></category>
		<category><![CDATA[command prompt]]></category>
		<category><![CDATA[cscript]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[enumerate]]></category>
		<category><![CDATA[groups]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[smtp address]]></category>
		<category><![CDATA[vb]]></category>
		<category><![CDATA[vbs]]></category>

		<guid isPermaLink="false">http://deludi.nl/blog/?p=670</guid>
		<description><![CDATA[The next script for today enumerates all hidden distribution groups. This is done by an ADO query with a filter on groups, msExchHideFromAddressLists and mail property. Follow the next steps to run the script (no admin rights needed): copy and paste the script in your favorite text editor save the script (for example c:temphidden-distribution-groups.vbs) open [...]]]></description>
			<content:encoded><![CDATA[<p>The next script for today enumerates all hidden distribution groups.<br />
This is done by an ADO query with a filter on groups, msExchHideFromAddressLists and mail property.  </p>
<p>Follow the next steps to run the script  (no admin rights needed):</p>
<ul>
<li>copy and paste the script in your favorite text editor</li>
<li>save the script (for example c:temphidden-distribution-groups.vbs)</li>
<li>open a command prompt</li>
<li>go to &#8220;c:temp&#8221;</li>
<li>give &#8220;cscript hidden-distribution-groups.vbs&#8221; (without quotes) and enter</li>
</ul>
<p>The script:</p>
<pre class="brush: vb; title: ; notranslate">
' Name : hidden-distribution-groups.vbs
' Description : script to enumerate all distribution groups that are hidden in the Global Address List
' Author : dirk adamsky - deludi bv
' Version : 1.00
' Date : 15-07-2010
' Level: intermediate

Set adoCommand = CreateObject(&quot;ADODB.Command&quot;)
Set adoConnection = CreateObject(&quot;ADODB.Connection&quot;)
adoConnection.Provider = &quot;ADsDSOObject&quot;
adoConnection.Open &quot;Active Directory Provider&quot;
adoCommand.ActiveConnection = adoConnection

Set objRootDSE = GetObject(&quot;LDAP://RootDSE&quot;)
strBase = &quot;&lt;LDAP://&quot; &amp; objRootDSE.Get(&quot;defaultNamingContext&quot;) &amp; &quot;&gt;&quot;
strFilter = &quot;(&amp;(objectCategory=group)(msExchHideFromAddressLists=TRUE)(mail=*))&quot;
strAttributes = &quot;displayname, mail, msExchHideFromAddressLists&quot;

strQuery = strBase &amp; &quot;;&quot; &amp; strFilter &amp; &quot;;&quot; &amp; strAttributes &amp; &quot;;subtree&quot;
adoCommand.CommandText = strQuery
adoCommand.Properties(&quot;Page Size&quot;) = 100
adoCommand.Properties(&quot;Timeout&quot;) = 30
adoCommand.Properties(&quot;Cache Results&quot;) = False

Set objRecordset = adoCommand.Execute

objRecordSet.MoveFirst
Do Until objRecordSet.EOF
	Wscript.Echo objRecordSet.Fields(&quot;displayname&quot;).Value &amp; &quot; ; &quot; &amp; objRecordSet.Fields(&quot;mail&quot;).Value
	objRecordSet.MoveNext
Loop

Set objRecordset = Nothing
Set objRootDSE = Nothing
Set adoConnection = Nothing
Set adoCommand = Nothing
</pre>
<p>When you have problems/questions please post a reply or give a &#8216;star&#8217; rating.</p>
<p>Happy scripting.</p>
<p>Best regards,</p>
<p>Dirk Adamsky &#8211; Deludi BV </p>
<div class="bottomcontainerBox" style="background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvbscriptblog.com%2Fvbscript%2Factive-directory-vbscript-to-enumerate-all-distribution-groups-that-are-hidden-in-the-global-addres-list%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://vbscriptblog.com/vbscript/active-directory-vbscript-to-enumerate-all-distribution-groups-that-are-hidden-in-the-global-addres-list/"></g:plusone>
			</div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://vbscriptblog.com/vbscript/active-directory-vbscript-to-enumerate-all-distribution-groups-that-are-hidden-in-the-global-addres-list/"  data-text="Active Directory: VBscript to enumerate all distribution groups that are hidden in the Global Address List" data-count="horizontal" data-via="dirkadamsky">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://vbscriptblog.com/vbscript/active-directory-vbscript-to-enumerate-all-distribution-groups-that-are-hidden-in-the-global-addres-list/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>]]></content:encoded>
			<wfw:commentRss>http://vbscriptblog.com/vbscript/active-directory-vbscript-to-enumerate-all-distribution-groups-that-are-hidden-in-the-global-addres-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Active Directory: VBscript to enumerate the members of remote desktop users group of all servers</title>
		<link>http://vbscriptblog.com/vbscript/active-directory-vbscript-to-enumerate-the-members-of-remote-desktop-users-group-of-all-servers/</link>
		<comments>http://vbscriptblog.com/vbscript/active-directory-vbscript-to-enumerate-the-members-of-remote-desktop-users-group-of-all-servers/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 12:15:25 +0000</pubDate>
		<dc:creator>dirk adamsky</dc:creator>
				<category><![CDATA[active directory]]></category>
		<category><![CDATA[remotedesktopusers]]></category>
		<category><![CDATA[vbscript]]></category>
		<category><![CDATA[adsi]]></category>
		<category><![CDATA[alive]]></category>
		<category><![CDATA[attribute]]></category>
		<category><![CDATA[command prompt]]></category>
		<category><![CDATA[cscript]]></category>
		<category><![CDATA[enumerate]]></category>
		<category><![CDATA[groups]]></category>
		<category><![CDATA[memberships]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[remote desktop users]]></category>
		<category><![CDATA[vb]]></category>

		<guid isPermaLink="false">http://deludi.nl/blog/?p=585</guid>
		<description><![CDATA[Script for today is about members of the remote desktop users local group. This group exists on all servers except the domain controllers. The script can take a long time in large domains because it connects each server separately. Follow the next steps to run the script (admin rights needed): copy and paste the script [...]]]></description>
			<content:encoded><![CDATA[<p>Script for today is about members of the remote desktop users local group.<br />
This group exists on all servers except the domain controllers.<br />
The script can take a long time in large domains because it connects each server separately.</p>
<p>Follow the next steps to run the script  (admin rights needed):</p>
<ul>
<li>copy and paste the script in your favorite text editor</li>
<li>save the script (for example c:tempremotedesktopusers.vbs)</li>
<li>open a command prompt</li>
<li>go to &#8220;c:temp&#8221;</li>
<li>give &#8220;cscript remotedesktopusers.vbs&#8221; (without quotes) and enter</li>
</ul>
<p>The script:</p>
<pre class="brush: vb; title: ; notranslate">
' Name : remotedesktopusers.vbs
' Description : script to enumerate the members of remote desktop users group of all servers
' Author : dirk adamsky - deludi bv
' Version : 1.00
' Date : 23-04-2010
' Level: intermediate

Set adoCommand = CreateObject(&quot;ADODB.Command&quot;)
Set adoConnection = CreateObject(&quot;ADODB.Connection&quot;)
adoConnection.Provider = &quot;ADsDSOObject&quot;
adoConnection.Open &quot;Active Directory Provider&quot;
adoCommand.ActiveConnection = adoConnection

Set objRootDSE = GetObject(&quot;LDAP://RootDSE&quot;)
strDNSDomain = objRootDSE.Get(&quot;defaultNamingContext&quot;)
strBase = &quot;&lt;LDAP://&quot; &amp; strDNSDomain &amp; &quot;&gt;&quot;

strFilter = &quot;(&amp;(objectCategory=computer)(operatingSystem=*server*))&quot;

strAttributes = &quot;name,distinguishedName&quot;
strQuery = strBase &amp; &quot;;&quot; &amp; strFilter &amp; &quot;;&quot; &amp; strAttributes &amp; &quot;;subtree&quot;
adoCommand.CommandText = strQuery
adoCommand.Properties(&quot;Page Size&quot;) = 100
adoCommand.Properties(&quot;Timeout&quot;) = 30
adoCommand.Properties(&quot;Cache Results&quot;) = False
Set adoRecordset = adoCommand.Execute

Do Until adoRecordset.EOF
	strHostname = adoRecordset.Fields(&quot;name&quot;).Value
	If CheckStatus(strHostname) = True Then
		If Instr(adoRecordset.Fields(&quot;distinguishedName&quot;).Value,&quot;Domain Controllers&quot;) = 0 Then
			Set objGroup = GetObject(&quot;WinNT://&quot; &amp; strHostname &amp; &quot;/Remote Desktop Users,group&quot;)
			For Each Member In objGroup.Members
				wscript.echo strHostname &amp; &quot; has &quot; &amp; Member.Name &amp; &quot; in the remote desktop users group&quot;
			Next
			Set objGroup = Nothing
		End If
	End If
	adoRecordset.MoveNext
Loop

adoRecordset.Close
adoConnection.Close

Set adoRecordset = Nothing
Set objRootDSE = Nothing
Set adoConnection = Nothing
Set adoCommand = Nothing

Function CheckStatus(strAddress)
	Dim objPing, objRetStatus
	Set objPing = GetObject(&quot;winmgmts:{impersonationLevel=impersonate}&quot;).ExecQuery _
      (&quot;select * from Win32_PingStatus where address = '&quot; &amp; strAddress &amp; &quot;'&quot;)
	For Each objRetStatus In objPing
        If IsNull(objRetStatus.StatusCode) Or objRetStatus.StatusCode &lt;&gt; 0 Then
			CheckStatus = False
        Else
			CheckStatus = True
        End If
    Next
	Set objPing = Nothing
End Function
</pre>
<p>When you have problems/questions please post a reply or give a &#8216;star&#8217; rating.</p>
<p>Happy scripting.</p>
<p>Best regards,</p>
<p>Dirk Adamsky &#8211; Deludi BV</p>
<div class="bottomcontainerBox" style="background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvbscriptblog.com%2Fvbscript%2Factive-directory-vbscript-to-enumerate-the-members-of-remote-desktop-users-group-of-all-servers%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://vbscriptblog.com/vbscript/active-directory-vbscript-to-enumerate-the-members-of-remote-desktop-users-group-of-all-servers/"></g:plusone>
			</div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://vbscriptblog.com/vbscript/active-directory-vbscript-to-enumerate-the-members-of-remote-desktop-users-group-of-all-servers/"  data-text="Active Directory: VBscript to enumerate the members of remote desktop users group of all servers" data-count="horizontal" data-via="dirkadamsky">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://vbscriptblog.com/vbscript/active-directory-vbscript-to-enumerate-the-members-of-remote-desktop-users-group-of-all-servers/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>]]></content:encoded>
			<wfw:commentRss>http://vbscriptblog.com/vbscript/active-directory-vbscript-to-enumerate-the-members-of-remote-desktop-users-group-of-all-servers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Active Directory: Vbscript to enumerate all users of a nested group with a citrix token</title>
		<link>http://vbscriptblog.com/vbscript/active-directory/citrix/active-directory-vbscript-to-enumerate-the-citrix-tokens-of-a-nested-group/</link>
		<comments>http://vbscriptblog.com/vbscript/active-directory/citrix/active-directory-vbscript-to-enumerate-the-citrix-tokens-of-a-nested-group/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 10:52:03 +0000</pubDate>
		<dc:creator>dirk adamsky</dc:creator>
				<category><![CDATA[citrix]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[attribute]]></category>
		<category><![CDATA[command prompt]]></category>
		<category><![CDATA[cscript]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[enumerate]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[groups]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[nested group]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[smtp address]]></category>
		<category><![CDATA[user]]></category>
		<category><![CDATA[vb]]></category>
		<category><![CDATA[vbs]]></category>
		<category><![CDATA[vbscript]]></category>

		<guid isPermaLink="false">http://deludi.nl/blog/?p=547</guid>
		<description><![CDATA[Script for today is a mutation of my previous enumerate nested group script. The script enumerates all nested group users with a citrix token. Follow the next steps to run the script (no admin rights needed): copy and paste the script in your favorite text editor change the distinguished name of the nested group to [...]]]></description>
			<content:encoded><![CDATA[<p>Script for today is a mutation of my previous <a href="http://deludi.nl/blog/vbscript/active-directory/groups/active-directory-vbscript-to-enumerate-the-members-of-nested-groups-v2/">enumerate nested group script</a>.<br />
The script enumerates all nested group users with a citrix token.</p>
<p>Follow the next steps to run the script  (no admin rights needed):</p>
<ul>
<li>copy and paste the script in your favorite text editor</li>
<li>change the distinguished name of the nested group to your group distinguished name</li>
<li>save the script (for example c:tempenumeratenestedgrouptokens.vbs)</li>
<li>open a command prompt</li>
<li>go to &#8220;c:temp&#8221;</li>
<li>give &#8220;cscript enumeratenestedgrouptokens.vbs&#8221; (without quotes) and enter</li>
</ul>
<p>The script:</p>
<pre class="brush: vb; title: ; notranslate">
' Name : enumeratenestedgrouptokens.vbs
' Description : script to enumerate the citrix tokens of a nested group
' Author : dirk adamsky - deludi bv
' Version : 1.00
' Date : 13-04-2010
' Level: intermediate
strTargetGroupDN = &quot;LDAP://CN=testgroup,OU=groups,DC=test,DC=org&quot;
EnumNestedgroup strTargetGroupDN
Sub EnumNestedgroup(strGroupDN)
	Set objGroup = GetObject(strGroupDN)
	For Each objMember in objGroup.Members
		If (LCase(objMember.Class) = &quot;group&quot;) Then
			EnumNestedgroup objMember.AdsPath
		ElseIf objMember.[securecomputingCom2000-SafeWord-UserID] &lt;&gt; &quot;&quot; Then
			Wscript.Echo objMember.DisplayName &amp; &quot; ; &quot; &amp; objMember.Mail &amp; &quot; ; &quot; &amp; objMember.[securecomputingCom2000-SafeWord-UserID]
		End If
	Next
	Set objGroup = Nothing
End Sub
</pre>
<p>When you have problems/questions please post a reply or give a &#8216;star&#8217; rating.</p>
<p>Happy scripting.</p>
<p>Best regards,</p>
<p>Dirk Adamsky &#8211; Deludi BV</p>
<div class="bottomcontainerBox" style="background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvbscriptblog.com%2Fvbscript%2Factive-directory%2Fcitrix%2Factive-directory-vbscript-to-enumerate-the-citrix-tokens-of-a-nested-group%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://vbscriptblog.com/vbscript/active-directory/citrix/active-directory-vbscript-to-enumerate-the-citrix-tokens-of-a-nested-group/"></g:plusone>
			</div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://vbscriptblog.com/vbscript/active-directory/citrix/active-directory-vbscript-to-enumerate-the-citrix-tokens-of-a-nested-group/"  data-text="Active Directory: Vbscript to enumerate all users of a nested group with a citrix token" data-count="horizontal" data-via="dirkadamsky">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://vbscriptblog.com/vbscript/active-directory/citrix/active-directory-vbscript-to-enumerate-the-citrix-tokens-of-a-nested-group/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>]]></content:encoded>
			<wfw:commentRss>http://vbscriptblog.com/vbscript/active-directory/citrix/active-directory-vbscript-to-enumerate-the-citrix-tokens-of-a-nested-group/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Active Directory: VBscript to enumerate the last logon of the members of a nested group with treshold</title>
		<link>http://vbscriptblog.com/vbscript/active-directory/lastlogon-active-directory-vbscript/active-directory-vbscript-to-enumerate-the-last-logon-of-the-members-of-a-nested-group-with-treshold/</link>
		<comments>http://vbscriptblog.com/vbscript/active-directory/lastlogon-active-directory-vbscript/active-directory-vbscript-to-enumerate-the-last-logon-of-the-members-of-a-nested-group-with-treshold/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 13:29:05 +0000</pubDate>
		<dc:creator>dirk adamsky</dc:creator>
				<category><![CDATA[lastlogon]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[adsi]]></category>
		<category><![CDATA[command prompt]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[enumerate]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[groups]]></category>
		<category><![CDATA[lastlogontimestamp]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[memberOf]]></category>
		<category><![CDATA[memberships]]></category>
		<category><![CDATA[nested group]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[smtp address]]></category>
		<category><![CDATA[user]]></category>
		<category><![CDATA[vb]]></category>
		<category><![CDATA[vbs]]></category>
		<category><![CDATA[vbscript]]></category>

		<guid isPermaLink="false">http://deludi.nl/blog/?p=453</guid>
		<description><![CDATA[Today I had to find out the lastlogon of the members of a nested group. Extra request was the users who&#8217;s lastlogon was longer than 90 days ago. I solved the problem by creating a script that was a combination of earlier scripts. The lastlogon code came from my lastlogon script, the enumeration of the [...]]]></description>
			<content:encoded><![CDATA[<p>Today I had to find out the lastlogon of the members of a nested group.<br />
Extra request was the users who&#8217;s lastlogon was longer than 90 days ago.<br />
I solved the problem by creating a script that was a combination of earlier scripts.<br />
The lastlogon code came from my <a href="http://deludi.nl/blog/vbscript/active-directory/lastlogon-active-directory-vbscript/active-directory-vbscript-to-enumerate-the-last-logon-of-all-ad-users-and-a-lot-of-user-attributes-v2/">lastlogon script</a>, the enumeration of the group members code was taken from my <a href="http://deludi.nl/blog/vbscript/active-directory/groups/active-directory-vbscript-to-enumerate-the-members-of-nested-groups-v2/">enumeratenestedgroup script</a>. The users with a lastlogon of 1-1-1601 did never log on.</p>
<p>Follow the next steps to run the script (no admin rights needed):</p>
<ul>
<li>open your favorite text editor</li>
<li>copy and paste the script into the editor</li>
<li>change the distinguished name of strTargetGroupDN to the distinguished name of your nested group</li>
<li>optionally: change the treshold value in line 17 to the desired value (example treshold value is 90 days)</li>
<li>save the script (for example c:tempenumerate-lastlogon-nestedgroup-with-treshold.vbs)</li>
<li>open a command prompt</li>
<li>go to &#8220;c:temp&#8221;</li>
<li>give &#8220;cscript enumerate-lastlogon-nestedgroup-with-treshold.vbs&#8221; (without quotes) and enter</li>
</ul>
<p>The script:</p>
<pre class="brush: vb; title: ; notranslate">
' Name : enumerate-lastlogon-nestedgroup-with-treshold.vbs
' Description : script to enumerate the last logon of the members of a nested group with treshold
' Author : dirk adamsky - deludi bv
' Version : 1.00
' Date : 23-03-2010
' Level : advanced

intBias = TimeZoneBias
strTargetGroupDN = &quot;LDAP://CN=Testgroup,OU=Groups,DC=Test,DC=org&quot;
EnumNestedgroup strTargetGroupDN
Sub EnumNestedgroup(strGroupDN)
	Set objGroup = GetObject(strGroupDN)
	For Each objMember in objGroup.Members
		If (LCase(objMember.Class) = &quot;group&quot;) Then
			EnumNestedgroup objMember.AdsPath
		Else
			CheckLastLoginWithTreshold objMember.AdsPath, 90
		End If
	Next
	Set objGroup = Nothing
End Sub

Sub CheckLastLoginWithTreshold(strDN,intTreshold)
	Set objUser = GetObject(strDN)
	On Error resume next
	Set objDate = objUser.Get(&quot;lastLogonTimestamp&quot;)
	If (Err.Number &lt;&gt; 0) Then
        dtmDate = #1/1/1601#
    Else
		dtmDate = ((((objDate.Highpart * (2^32)) + objDate.LowPart)/(600000000 - intBias))/1440) + #1/1/1601#
	End If
	Set objDate = Nothing
	If DateDiff(&quot;d&quot;,dtmDate,Date) &gt; intTreshold Then
		Wscript.Echo objUser.Displayname &amp; &quot; ; &quot; &amp; objUser.Mail &amp; &quot; ; &quot; &amp; dtmDate
	End If
	Set objUser = Nothing
End Sub

Function TimeZoneBias
	strComputer = &quot;.&quot;
	Set objWMIService = GetObject(&quot;winmgmts:{impersonationLevel=impersonate}!\&quot; &amp; strComputer &amp; &quot;rootcimv2&quot;)
	Set colTimeZone = objWMIService.ExecQuery(&quot;Select * from Win32_TimeZone&quot;)
	For Each objTimeZone in colTimeZone
		TimeZoneBias = objTimeZone.Bias
	Next
	Set colTimeZone = Nothing
	Set objWMIService = Nothing
End Function
</pre>
<p>When you have problems/questions please post a reply.</p>
<p>Happy scripting.</p>
<p>Best regards,</p>
<p>Dirk Adamsky &#8211; Deludi BV</p>
<p>&nbsp;</p>
<div class="bottomcontainerBox" style="background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvbscriptblog.com%2Fvbscript%2Factive-directory%2Flastlogon-active-directory-vbscript%2Factive-directory-vbscript-to-enumerate-the-last-logon-of-the-members-of-a-nested-group-with-treshold%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://vbscriptblog.com/vbscript/active-directory/lastlogon-active-directory-vbscript/active-directory-vbscript-to-enumerate-the-last-logon-of-the-members-of-a-nested-group-with-treshold/"></g:plusone>
			</div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://vbscriptblog.com/vbscript/active-directory/lastlogon-active-directory-vbscript/active-directory-vbscript-to-enumerate-the-last-logon-of-the-members-of-a-nested-group-with-treshold/"  data-text="Active Directory: VBscript to enumerate the last logon of the members of a nested group with treshold" data-count="horizontal" data-via="dirkadamsky">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://vbscriptblog.com/vbscript/active-directory/lastlogon-active-directory-vbscript/active-directory-vbscript-to-enumerate-the-last-logon-of-the-members-of-a-nested-group-with-treshold/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>]]></content:encoded>
			<wfw:commentRss>http://vbscriptblog.com/vbscript/active-directory/lastlogon-active-directory-vbscript/active-directory-vbscript-to-enumerate-the-last-logon-of-the-members-of-a-nested-group-with-treshold/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Active Directory: VBscript to enumerate all empty groups</title>
		<link>http://vbscriptblog.com/vbscript/active-directory/groups/active-directory-vbscript-to-enumerate-all-empty-groups/</link>
		<comments>http://vbscriptblog.com/vbscript/active-directory/groups/active-directory-vbscript-to-enumerate-all-empty-groups/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 12:11:13 +0000</pubDate>
		<dc:creator>dirk adamsky</dc:creator>
				<category><![CDATA[groups]]></category>
		<category><![CDATA[command prompt]]></category>
		<category><![CDATA[cscript]]></category>
		<category><![CDATA[distribution group]]></category>
		<category><![CDATA[empty groups]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[memberships]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[vb]]></category>
		<category><![CDATA[vbs]]></category>
		<category><![CDATA[vbscript]]></category>

		<guid isPermaLink="false">http://deludi.nl/blog/?p=443</guid>
		<description><![CDATA[For most system administrators cleaning up Active Directory is not their favorite thing. This script helps you by enumerating all empty groups, so you can remove them (manually). Follow the next steps to run the script (no admin rights needed): * open your favorite text editor * copy and paste the script into the editor [...]]]></description>
			<content:encoded><![CDATA[<p>For most system administrators cleaning up Active Directory is not their favorite thing.<br />
This script helps you by enumerating all empty groups, so you can remove them (manually).</p>
<p>Follow the next steps to run the script (no admin rights needed):</p>
<p>* open your favorite text editor<br />
* copy and paste the script into the editor<br />
* save the script (for example c:\temp\emptygroups.vbs)<br />
* open a command prompt<br />
* go to &#8220;c:\temp&#8221;<br />
* give &#8220;cscript emptygroups.vbs&#8221; (without quotes) and enter</p>
<p>The script:</p>
<pre class="brush: vb; title: ; notranslate">
' Name : emptygroups.vbs
' Description : script to enumerate all empty groups
' Author : dirk adamsky - deludi bv
' Version : 1.00
' Date : 18-03-2010
' Level : intermediate

Set objCommand = CreateObject(&quot;ADODB.Command&quot;)
Set objConnection = CreateObject(&quot;ADODB.Connection&quot;)
objConnection.Provider = &quot;ADsDSOObject&quot;
objConnection.Open &quot;Active Directory Provider&quot;
objCommand.ActiveConnection = objConnection

Set objRootDSE = GetObject(&quot;LDAP://RootDSE&quot;)
strBase = &quot;&lt;LDAP://&quot; &amp; objRootDSE.Get(&quot;defaultNamingContext&quot;) &amp; &quot;&gt;&quot;
Set objRootDSE = Nothing

strFilter = &quot;(&amp;(objectCategory=group)(!member=*))&quot;
strAttributes = &quot;name&quot;
strQuery = strBase &amp; &quot;;&quot; &amp; strFilter &amp; &quot;;&quot; &amp; strAttributes &amp; &quot;;subtree&quot;
objCommand.CommandText = strQuery
objCommand.Properties(&quot;Page Size&quot;) = 100
objCommand.Properties(&quot;Timeout&quot;) = 30
objCommand.Properties(&quot;Cache Results&quot;) = False

Set objRecordSet = objCommand.Execute
Do Until objRecordSet.EOF
	Wscript.Echo objRecordSet.Fields(&quot;name&quot;).Value
	objRecordSet.MoveNext
Loop

objRecordSet.Close
objConnection.Close

Set objRecordSet = Nothing
Set objConnection = Nothing
Set objCommand = Nothing
</pre>
<p>When you have problems/questions please post a reply, you can also rate the script.</p>
<p>Happy scripting.</p>
<p>Best regards,</p>
<p>Dirk Adamsky &#8211; Deludi BV</p>
<div class="bottomcontainerBox" style="background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvbscriptblog.com%2Fvbscript%2Factive-directory%2Fgroups%2Factive-directory-vbscript-to-enumerate-all-empty-groups%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://vbscriptblog.com/vbscript/active-directory/groups/active-directory-vbscript-to-enumerate-all-empty-groups/"></g:plusone>
			</div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://vbscriptblog.com/vbscript/active-directory/groups/active-directory-vbscript-to-enumerate-all-empty-groups/"  data-text="Active Directory: VBscript to enumerate all empty groups" data-count="horizontal" data-via="dirkadamsky">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://vbscriptblog.com/vbscript/active-directory/groups/active-directory-vbscript-to-enumerate-all-empty-groups/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>]]></content:encoded>
			<wfw:commentRss>http://vbscriptblog.com/vbscript/active-directory/groups/active-directory-vbscript-to-enumerate-all-empty-groups/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Active Directory: VBscript to show all groups with multiple smtp addresses</title>
		<link>http://vbscriptblog.com/vbscript/active-directory/groups/active-directory-vbscript-to-show-all-groups-with-multiple-smtp-addresses/</link>
		<comments>http://vbscriptblog.com/vbscript/active-directory/groups/active-directory-vbscript-to-show-all-groups-with-multiple-smtp-addresses/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 08:06:08 +0000</pubDate>
		<dc:creator>dirk adamsky</dc:creator>
				<category><![CDATA[groups]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[attribute]]></category>
		<category><![CDATA[command prompt]]></category>
		<category><![CDATA[cscript]]></category>
		<category><![CDATA[distribution group]]></category>
		<category><![CDATA[enumerate]]></category>
		<category><![CDATA[exchange]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[smtp address]]></category>
		<category><![CDATA[user]]></category>
		<category><![CDATA[vb]]></category>
		<category><![CDATA[vbs]]></category>
		<category><![CDATA[vbscript]]></category>

		<guid isPermaLink="false">http://deludi.nl/blog/?p=345</guid>
		<description><![CDATA[This script is a mutation of yesterday&#8217;s script. It searches Active Directory for mail enabled groups with multiple smtp addresses. By changing the treshold value (i) in line number 39 you can broaden or narrow your searches. Follow the next steps to run the script (no admin rights needed): * open your favorite text editor [...]]]></description>
			<content:encoded><![CDATA[<p>This script is a mutation of <a href="http://deludi.nl/blog/vbscript/active-directory/email/active-directory-vbscript-to-show-all-users-with-multiple-smtp-addresses/">yesterday&#8217;s script.</a><br />
It searches Active Directory for mail enabled groups with multiple smtp addresses.<br />
By changing the treshold value (i) in line number 39 you can broaden or narrow your searches.</p>
<p>Follow the next steps to run the script (no admin rights needed):</p>
<p>* open your favorite text editor<br />
* copy and paste the script into the editor<br />
* save the script (for example c:tempshowgroupswithmultiplesmtp.vbs)<br />
* open a command prompt<br />
* go to &#8220;c:temp&#8221;<br />
* give &#8220;cscript showgroupswithmultiplesmtp.vbs&#8221; (without quotes) and enter</p>
<p>The script:</p>
<pre class="brush: vb; title: ; notranslate">
' Name : showgroupswithmultiplesmtp.vbs
' Description : script to show all groups with multiple smtp addresses
' Author : dirk adamsky - deludi bv
' Version : 1.00
' Date : 23-02-2010
' Level : intermediate

Set adoCommand = CreateObject(&quot;ADODB.Command&quot;)
Set adoConnection = CreateObject(&quot;ADODB.Connection&quot;)
adoConnection.Provider = &quot;ADsDSOObject&quot;
adoConnection.Open &quot;Active Directory Provider&quot;
adoCommand.ActiveConnection = adoConnection

Set objRootDSE = GetObject(&quot;LDAP://RootDSE&quot;)
strDNSDomain = objRootDSE.Get(&quot;defaultNamingContext&quot;)
strBase = &quot;&lt;LDAP://&quot; &amp; strDNSDomain &amp; &quot;&gt;&quot;

strFilter = &quot;(&amp;(objectCategory=group)(mail=*))&quot;
strAttributes = &quot;distinguishedName&quot;

strQuery = strBase &amp; &quot;;&quot; &amp; strFilter &amp; &quot;;&quot; &amp; strAttributes &amp; &quot;;subtree&quot;
adoCommand.CommandText = strQuery
adoCommand.Properties(&quot;Page Size&quot;) = 100
adoCommand.Properties(&quot;Timeout&quot;) = 30
adoCommand.Properties(&quot;Cache Results&quot;) = False

Set adoRecordset = adoCommand.Execute

Do Until adoRecordset.EOF
	On Error Resume Next
	Set objGroup = GetObject (&quot;LDAP://&quot; &amp; adoRecordset.Fields(&quot;distinguishedName&quot;).Value)
	arrProxy = objGroup.GetEx(&quot;proxyAddresses&quot;)
	i = 0
	For Each strMailAddress in arrProxy
		If Lcase(Left(strMailAddress,5))= &quot;smtp:&quot; Then
			i = i + 1
		End If
	Next
	If i &gt;= 2 Then
		strAllMailAddresses = &quot;&quot;
		For Each strMailAddress in arrProxy
			If Lcase(Left(strMailAddress,5))= &quot;smtp:&quot; Then
				strAllMailAddresses = strAllMailAddresses &amp; &quot; ; &quot;  &amp; strMailAddress
			End If
		Next
		Wscript.Echo objGroup.DisplayName &amp; strAllMailAddresses
	End If
	Set objGroup = Nothing
	adoRecordset.MoveNext
Loop

adoRecordset.Close
adoConnection.Close

Set adoRecordset = Nothing
Set objRootDSE = Nothing
Set adoConnection = Nothing
Set adoCommand = Nothing
</pre>
<p>When you have problems/questions please post a reply.<br />
I also added a rating system yesterday, thank you in advance for your reaction.</p>
<p>Happy scripting.</p>
<p>Best regards,</p>
<p>Dirk Adamsky &#8211; Deludi BV</p>
<div class="bottomcontainerBox" style="background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvbscriptblog.com%2Fvbscript%2Factive-directory%2Fgroups%2Factive-directory-vbscript-to-show-all-groups-with-multiple-smtp-addresses%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://vbscriptblog.com/vbscript/active-directory/groups/active-directory-vbscript-to-show-all-groups-with-multiple-smtp-addresses/"></g:plusone>
			</div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://vbscriptblog.com/vbscript/active-directory/groups/active-directory-vbscript-to-show-all-groups-with-multiple-smtp-addresses/"  data-text="Active Directory: VBscript to show all groups with multiple smtp addresses" data-count="horizontal" data-via="dirkadamsky">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://vbscriptblog.com/vbscript/active-directory/groups/active-directory-vbscript-to-show-all-groups-with-multiple-smtp-addresses/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>]]></content:encoded>
			<wfw:commentRss>http://vbscriptblog.com/vbscript/active-directory/groups/active-directory-vbscript-to-show-all-groups-with-multiple-smtp-addresses/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Active Directory: VBscript to count users with multiple entries in a nested distribution group</title>
		<link>http://vbscriptblog.com/vbscript/active-directory/distributiongroups/active-directory-vbscript-to-count-users-with-multiple-entries-in-a-nested-distribution-group/</link>
		<comments>http://vbscriptblog.com/vbscript/active-directory/distributiongroups/active-directory-vbscript-to-count-users-with-multiple-entries-in-a-nested-distribution-group/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 13:20:13 +0000</pubDate>
		<dc:creator>dirk adamsky</dc:creator>
				<category><![CDATA[distributiongroups]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[attribute]]></category>
		<category><![CDATA[command prompt]]></category>
		<category><![CDATA[cscript]]></category>
		<category><![CDATA[distribution group]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[enumerate]]></category>
		<category><![CDATA[exchange]]></category>
		<category><![CDATA[groups]]></category>
		<category><![CDATA[homedirectory]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[memberships]]></category>
		<category><![CDATA[nested group]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[smtp address]]></category>
		<category><![CDATA[user]]></category>
		<category><![CDATA[vb]]></category>
		<category><![CDATA[vbscript]]></category>
		<category><![CDATA[wmi]]></category>

		<guid isPermaLink="false">http://deludi.nl/blog/?p=302</guid>
		<description><![CDATA[This script is something I wanted to do for a long time It is a mutation of the enumeratenestedgroupV2 script. In large organizations the main distributiongroups tend to be complex also. Often the distributiongroups represent the organization hierarchy. A user in general only needs his/her department distributiongroup membership. This script checks If a user has [...]]]></description>
			<content:encoded><![CDATA[<p>This script is something I wanted to do for a long time<br />
It is a mutation of the  <a href="http://deludi.nl/blog/vbscript/active-directory/groups/active-directory-vbscript-to-enumerate-the-members-of-nested-groups-v2/">enumeratenestedgroupV2</a> script.<br />
In large organizations the main distributiongroups tend to be complex also.<br />
Often the distributiongroups represent the organization hierarchy.<br />
A user in general only needs his/her department distributiongroup membership.<br />
This script checks If a user has multiple entries in the main distributiongroup, if so an entry is added to the output.<br />
Part of the script is the use of the dictionary object, also known as &#8220;associative array&#8221; in other scripting languages.</p>
<p>What the script does:</p>
<ul>
<li>create a dictionary object</li>
<li>fill a variable with the group distinguished name</li>
<li>call the subroutine EnumNestedgroup</li>
<li>the subroutine checks whether the member is a group or a user</li>
<li>when the member is a user the smtp address is added to the dictionary object with value 1</li>
<li>when the smtp address is already in the dictionary 1 is added to the value</li>
<li>the last routine echoes the dictionary object keys and values</li>
</ul>
<p>Follow the next steps to run the script  (no admin rights needed):</p>
<ul>
<li>find the distinguished name of the nested group (adsiedit.msc)</li>
<li>open your favorite text editor</li>
<li>copy and paste the script into the editor</li>
<li>change the distinguished name</li>
<li>save the script (for example c:tempcountmembershipnestedgroup.vbs)</li>
<li>open a command prompt</li>
<li>go to &#8220;c:temp&#8221;</li>
<li>give &#8220;cscript enumeratenestedgroup.vbs&#8221; (without quotes) and enter</li>
</ul>
<p>The script:</p>
<pre class="brush: vb; title: ; notranslate">
' Name : countmembershipnestedgroup.vbs
' Description : script to count users with multiple entries in a nested distribution group
' Author : dirk adamsky - deludi bv
' Version : 1.00
' Date : 16-02-2010
' Level : advanced

Set objDictionary = CreateObject(&quot;Scripting.Dictionary&quot;)
strTargetGroupDN = &quot;LDAP://CN=testgroup,OU=groups,DC=test,DC=org&quot;
Call EnumNestedgroup(strTargetGroupDN)

Sub EnumNestedgroup(strGroupDN)
	Set objGroup = GetObject(strGroupDN)
	For Each objMember in objGroup.Members
		If (LCase(objMember.Class) = &quot;group&quot;) Then
			Call EnumNestedgroup(objMember.AdsPath)
		Else
			If objDictionary.Exists(objMember.DisplayName) Then
				objDictionary.Item(objMember.DisplayName) = objDictionary.Item(objMember.DisplayName) + 1
			Else
				objDictionary.Add objMember.DisplayName, 1
			End If
		End If
	Next
	Set objGroup = Nothing
End Sub

For Each strKey in objDictionary.Keys
	If objDictionary.Item(strKey) &gt; 1 Then
		Wscript.Echo strKey &amp; &quot; ; &quot; &amp; objDictionary.Item(strKey) &amp; &quot; ; entries in list&quot;
	End If
Next

Set objDictionary = Nothing
</pre>
<p>When you have problems/questions please post a reply.</p>
<p>Happy scripting.</p>
<p>Dirk Adamsky &#8211; Deludi BV</p>
<div class="bottomcontainerBox" style="background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvbscriptblog.com%2Fvbscript%2Factive-directory%2Fdistributiongroups%2Factive-directory-vbscript-to-count-users-with-multiple-entries-in-a-nested-distribution-group%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://vbscriptblog.com/vbscript/active-directory/distributiongroups/active-directory-vbscript-to-count-users-with-multiple-entries-in-a-nested-distribution-group/"></g:plusone>
			</div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://vbscriptblog.com/vbscript/active-directory/distributiongroups/active-directory-vbscript-to-count-users-with-multiple-entries-in-a-nested-distribution-group/"  data-text="Active Directory: VBscript to count users with multiple entries in a nested distribution group" data-count="horizontal" data-via="dirkadamsky">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://vbscriptblog.com/vbscript/active-directory/distributiongroups/active-directory-vbscript-to-count-users-with-multiple-entries-in-a-nested-distribution-group/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>]]></content:encoded>
			<wfw:commentRss>http://vbscriptblog.com/vbscript/active-directory/distributiongroups/active-directory-vbscript-to-count-users-with-multiple-entries-in-a-nested-distribution-group/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

