<?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; citrix</title>
	<atom:link href="http://vbscriptblog.com/category/vbscript/active-directory/citrix/feed/" rel="self" type="application/rss+xml" />
	<link>http://vbscriptblog.com</link>
	<description>Scripting for Windows Sysadmins</description>
	<lastBuildDate>Wed, 11 Apr 2012 07:23:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Active Directory: Vbscript to enumerate the lastlogon of all users of a nested group</title>
		<link>http://vbscriptblog.com/vbscript/active-directory/citrix/active-directory-vbscript-to-enumerate-the-lastlogon-of-all-users-of-a-nested-group/</link>
		<comments>http://vbscriptblog.com/vbscript/active-directory/citrix/active-directory-vbscript-to-enumerate-the-lastlogon-of-all-users-of-a-nested-group/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 12:14:01 +0000</pubDate>
		<dc:creator>dirk adamsky</dc:creator>
				<category><![CDATA[citrix]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[command prompt]]></category>
		<category><![CDATA[cscript]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[enumerate]]></category>
		<category><![CDATA[nested group]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[recursion]]></category>
		<category><![CDATA[smtp address]]></category>
		<category><![CDATA[user]]></category>
		<category><![CDATA[vb]]></category>
		<category><![CDATA[vbscript]]></category>

		<guid isPermaLink="false">http://deludi.nl/blog/?p=558</guid>
		<description><![CDATA[Ok let&#8217;s do another nested group script. This script enumerates the lastlogon of all members of a nested group. Attention: the lastlogontimestamp attribute has a treshold of 2 weeks, so recently added users might not occur in the output of the script. Follow the next steps to run the script (no admin rights needed): copy [...]]]></description>
			<content:encoded><![CDATA[<p>Ok let&#8217;s do another nested group script.<br />
This script enumerates the lastlogon of all members of a nested group.<br />
Attention: the lastlogontimestamp attribute has a treshold of 2 weeks, so recently added users might not occur in the output of the script.</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:tempenumeratenestedgrouplastlogon.vbs)</li>
<li>open a command prompt</li>
<li>go to &#8220;c:temp&#8221;</li>
<li>give &#8220;cscript enumeratenestedgrouplastlogon.vbs&#8221; (without quotes) and enter</li>
</ul>
<p>The script:</p>
<pre class="brush: vb; title: ; notranslate">
' Name : enumeratenestedgrouplastlogon.vbs
' Description : script to enumerate the lastlogon of all users of a nested group
' Author : dirk adamsky - deludi bv
' Version : 1.00
' Date : 13-04-2010
' Level: intermediate

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
		ElseIf TypeName(objMember.lastLogonTimeStamp) &lt;&gt; &quot;Empty&quot; Then
			Set objDate = objMember.lastLogonTimeStamp
			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
			Wscript.Echo objMember.DisplayName &amp; &quot; ; &quot; &amp; objMember.Mail &amp; &quot; ; &quot; &amp; dtmDate
		End If
	Next
	Set objGroup = 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 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-lastlogon-of-all-users-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" allowTransparency="true" style="border:none; overflow:hidden; width:85px; height:21px;"></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-lastlogon-of-all-users-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-lastlogon-of-all-users-of-a-nested-group/"  data-text="Active Directory: Vbscript to enumerate the lastlogon of all users of a nested group" data-count="horizontal" data-via="dirkadamsky"></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-lastlogon-of-all-users-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-lastlogon-of-all-users-of-a-nested-group/feed/</wfw:commentRss>
		<slash:comments>0</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" allowTransparency="true" style="border:none; overflow:hidden; width:85px; height:21px;"></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"></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 Citrix tokens</title>
		<link>http://vbscriptblog.com/vbscript/active-directory/active-directory-vbscript-to-enumerate-citrix-tokens/</link>
		<comments>http://vbscriptblog.com/vbscript/active-directory/active-directory-vbscript-to-enumerate-citrix-tokens/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 14:26:23 +0000</pubDate>
		<dc:creator>dirk adamsky</dc:creator>
				<category><![CDATA[active directory]]></category>
		<category><![CDATA[citrix]]></category>
		<category><![CDATA[adsi]]></category>
		<category><![CDATA[attribute]]></category>
		<category><![CDATA[command prompt]]></category>
		<category><![CDATA[cscript]]></category>
		<category><![CDATA[enumerate]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[tokens]]></category>
		<category><![CDATA[vbs]]></category>
		<category><![CDATA[vbscript]]></category>

		<guid isPermaLink="false">http://deludi.nl/blog/?p=28</guid>
		<description><![CDATA[This script enumerates all Citrix tokens in Active Directory. Follow the next steps (no admin rights needed): open your favorite text editor copy and paste the script into the editor save the script (for example c:tempcitrixtokens.vbs) open a command prompt go to &#8220;c:temp&#8221; give &#8220;cscript citrixtokens.vbs&#8221; (without quotes) and enter The script:]]></description>
			<content:encoded><![CDATA[<p>This script enumerates all Citrix tokens in Active Directory.</p>
<p>Follow the next steps (no admin rights needed):</p>
<ul>
<li>open your favorite text editor</li>
<li>copy and paste the script into the editor</li>
<li>save the script (for example c:tempcitrixtokens.vbs)</li>
<li>open a command prompt</li>
<li>go to &#8220;c:temp&#8221;</li>
<li>give &#8220;cscript citrixtokens.vbs&#8221; (without quotes) and enter</li>
</ul>
<p>The script:</p>
<pre class="brush: vb; title: ; notranslate">
' Name : citrixtokens.vbs
' Description : script to enumerate citrix tokens
' Author : dirk adamsky - deludi bv
' Version : 1.00
' Date : 11-01-2010

Option Explicit
Dim adoCommand, adoConnection, strBase, strFilter, strAttributes, strCN, arrToken, strToken
Dim objRootDSE, strDNSDomain, strQuery, adoRecordset, strUserDN, objUser, protocolSettings, strMail

' Setup ADO objects.
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))&quot;

' Comma delimited list of attribute values to retrieve.
strAttributes = &quot;mail,cn,securecomputingCom2000-SafeWord-UserID&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

' Enumerate the resulting recordset.
Do Until adoRecordset.EOF
    On Error Resume Next
    If adoRecordset.Fields(&quot;securecomputingCom2000-SafeWord-UserID&quot;).Actualsize &lt;&gt; 0 Then
        strCN = adoRecordset.Fields(&quot;cn&quot;).Value
        strMail = adoRecordset.Fields(&quot;mail&quot;).Value
        arrToken = adoRecordset.Fields(&quot;securecomputingCom2000-SafeWord-UserID&quot;).Value
        For each strToken in arrToken
            If strToken &gt; 0 Then
                Wscript.echo strMail &amp; &quot; ; &quot; &amp; strCN &amp; &quot; ; &quot; &amp; strToken
            End If
        Next
    End if
    'Move to the next record in the recordset.
    adoRecordset.MoveNext
Loop
' Clean up.
adoRecordset.Close
adoConnection.Close

Set adoRecordset = Nothing
Set objRootDSE = Nothing
Set adoConnection = Nothing
Set adoCommand = Nothing
</pre>
<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%2Factive-directory-vbscript-to-enumerate-citrix-tokens%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" allowTransparency="true" style="border:none; overflow:hidden; width:85px; height:21px;"></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/active-directory-vbscript-to-enumerate-citrix-tokens/"></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/active-directory-vbscript-to-enumerate-citrix-tokens/"  data-text="Active Directory: VBScript to enumerate Citrix tokens" data-count="horizontal" data-via="dirkadamsky"></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/active-directory-vbscript-to-enumerate-citrix-tokens/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>]]></content:encoded>
			<wfw:commentRss>http://vbscriptblog.com/vbscript/active-directory/active-directory-vbscript-to-enumerate-citrix-tokens/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

