<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Alfa BBT &#187; ADFind</title>
	<atom:link href="http://blog.koenvermoesen.be/tag/adfind/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.koenvermoesen.be</link>
	<description>Allways looking for a better Blog Title...</description>
	<lastBuildDate>Fri, 27 Jan 2012 16:45:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.koenvermoesen.be' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/72db48a689a5327f7bba8c9193cac8af?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Alfa BBT &#187; ADFind</title>
		<link>http://blog.koenvermoesen.be</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.koenvermoesen.be/osd.xml" title="Alfa BBT" />
	<atom:link rel='hub' href='http://blog.koenvermoesen.be/?pushpress=hub'/>
		<item>
		<title>ADFind Oneliners</title>
		<link>http://blog.koenvermoesen.be/2009/06/29/adfind-onelines/</link>
		<comments>http://blog.koenvermoesen.be/2009/06/29/adfind-onelines/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 12:51:37 +0000</pubDate>
		<dc:creator>Koen Vermoesen</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[ADFind]]></category>
		<category><![CDATA[LDAP]]></category>

		<guid isPermaLink="false">http://blog.koenvermoesen.be/?p=433</guid>
		<description><![CDATA[I&#8217;m very fond of the powerful AdFind command line utility from joeware.net. Here&#8217;s a little list I&#8217;m keeping for my own reference: Find the user behind a GUID: Likewise, you can use the same tool to find the e-mail address of a certain user: The command above is actually part of script, so I used [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.koenvermoesen.be&amp;blog=3561314&amp;post=433&amp;subd=k0v3&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m very fond of the powerful <a href="http://adfind.joeware.net/freetools/tools/adfind/index.htm">AdFind</a> command line utility from <a href="http://blog.joeware.net/">joeware.net</a>. Here&#8217;s a little list I&#8217;m keeping for my own reference:</p>
<p>Find the user behind a GUID:</p>
<p><pre class="brush: plain;">adfind -binenc -gc -s subtree -b dc=test,dc=com -f &quot;objectGUID={{GUID:????????-????-????-????-????????????}}&quot; displayName</pre></p>
<p>Likewise, you can use the same tool to find the e-mail address of a certain user:</p>
<p><pre class="brush: plain; first-line: 2;">adfind -gc -b dc=???,dc=??? -nodn -nolabel -f &quot;sAMAccountName=??????&quot; mail</pre></p>
<p>The command above is actually part of script, so I used the &#8220;-nodn&#8221; and &#8220;-nolabel&#8221; parameters to have the tool only return the e-mail address. You obviously need to replace the question marks with something meaningful in the examples above.</p>
<p>List all distribution groups:</p>
<p><pre class="brush: plain; first-line: 3;">adfind -csv -nodn -f &quot;(&amp;(objectcategory=group)(mail=*))&quot; displayname</pre></p>
<p>List all contacts:</p>
<p><pre class="brush: plain; first-line: 4;">adfind -csv -nodn -f &quot;(&amp;(&amp;(&amp; (mailnickname=*) (| (&amp;(objectCategory=person)(objectClass=contact)) ))))&quot; displayname</pre></p>
<p>List all mailbox-enabled users:</p>
<p><pre class="brush: plain; first-line: 5;">adfind -csv -nodn -f &quot;(&amp;(&amp;(&amp; (mailnickname=*) (| (&amp;(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*))) ))))&quot; displayname</pre></p>
<p>Run a query against another domain:</p>
<p><pre class="brush: plain; first-line: 6;">adfind -h %servername% -u %domain%\%username% -up %password% -csv -nodn -f &quot;displayname=John Doe&quot; displayname</pre></p>
<p>List all the members of a DL (and optionally use the resulting dn to retrieve some more readable information):</p>
<p><pre class="brush: plain; first-line: 7;">adfind -list -f &quot;DisplayName=%displayname%&quot; member
adfind -list -f &quot;DisplayName=%displayname%&quot; member | adfind -csv -nodn mailnickname displayname mail</pre></p>
<p>Report on the usage of Extension Attributes:</p>
<p><pre class="brush: plain; first-line: 9;">adfind -csv -nodn -f &quot;(|(ExtensionAttribute1=*)(ExtensionAttribute2=*)(ExtensionAttribute3=*)(ExtensionAttribute4=*)(ExtensionAttribute5=*)(ExtensionAttribute6=*)(ExtensionAttribute7=*)(ExtensionAttribute8=*)(ExtensionAttribute9=*)(ExtensionAttribute10=*)(ExtensionAttribute11=*)(ExtensionAttribute12=*)(ExtensionAttribute13=*)(ExtensionAttribute14=*)(ExtensionAttribute15=*))&quot; displayname ExtensionAttribute1 ExtensionAttribute2 ExtensionAttribute3 ExtensionAttribute4 ExtensionAttribute5 ExtensionAttribute6 ExtensionAttribute7 ExtensionAttribute8 ExtensionAttribute9 ExtensionAttribute10 ExtensionAttribute11 ExtensionAttribute12 ExtensionAttribute13 ExtensionAttribute14 ExtensionAttribute15</pre></p>
<p>Count the number of mailboxes on an exchange server:</p>
<p><pre class="brush: plain; first-line: 10;">adfind -c -f &quot;msExchHomeServerName=/o=EMS/ou=First Administrative Group/cn=Configuration/cn=Servers/cn=%servername%&quot;</pre></p>
<p>Imagine you&#8217;re working as a consultant/contractor for a large organisation and you want to know the end date of you contract:</p>
<p><pre class="brush: plain; first-line: 11;">adfind -tdcs -f &quot;samaccountname=%UserName%&quot; accountExpires</pre></p>
<p>The &#8220;tdcs&#8221; parameter converts the time in a human readable format.</p>
<p>Somebody called you on your mobile phone and you want to know who:</p>
<p><pre class="brush: plain; first-line: 12;">adfind -list -f &quot;telephoneNumber=*%extension%&quot; displayname</pre></p>
<p>More info</p>
<ul>
<li><a href="http://www.msexchange.org/articles/Scripting-Exchange-VBScript-ADSI-Part1.html">msexchange.org</a></li>
<li><a href="http://theessentialexchange.com/blogs/michael/archive/2007/11/13/listing-members-of-distribution-lists-and-security-groups.aspx">theessentialexchange.com</a></li>
<li><a href="http://www.petri.co.il/forums/showthread.php?t=17675">petri.co.il</a></li>
<li><a href="http://www.petri.co.il/ldap_search_samples_for_windows_2003_and_exchange.htm">petri.co.il</a></li>
</ul>
<br />Posted in Active Directory, Scripting Tagged: ADFind, LDAP <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/k0v3.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/k0v3.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/k0v3.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/k0v3.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/k0v3.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/k0v3.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/k0v3.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/k0v3.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/k0v3.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/k0v3.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/k0v3.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/k0v3.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/k0v3.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/k0v3.wordpress.com/433/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.koenvermoesen.be&amp;blog=3561314&amp;post=433&amp;subd=k0v3&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.koenvermoesen.be/2009/06/29/adfind-onelines/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4f646bcfc3f7534b20fa79e0347353eb?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">k0v3</media:title>
		</media:content>
	</item>
	</channel>
</rss>
