<?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>Dmitry's PowerBlog: PowerShell and beyond &#187; AD</title>
	<atom:link href="http://dmitrysotnikov.wordpress.com/category/ad/feed/" rel="self" type="application/rss+xml" />
	<link>http://dmitrysotnikov.wordpress.com</link>
	<description>Dmitry Sotnikov's view on PowerShell, PowerGUI and everything he sees around</description>
	<lastBuildDate>Mon, 30 Nov 2009 11:00:31 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='dmitrysotnikov.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/930c8793b5aed06d07140b3be0db9d23?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Dmitry's PowerBlog: PowerShell and beyond &#187; AD</title>
		<link>http://dmitrysotnikov.wordpress.com</link>
	</image>
			<item>
		<title>New cmdlets to manage AD computer accounts</title>
		<link>http://dmitrysotnikov.wordpress.com/2009/11/27/new-cmdlets-to-manage-ad-computer-accounts/</link>
		<comments>http://dmitrysotnikov.wordpress.com/2009/11/27/new-cmdlets-to-manage-ad-computer-accounts/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 11:00:09 +0000</pubDate>
		<dc:creator>Dmitry Sotnikov</dc:creator>
				<category><![CDATA[AD]]></category>
		<category><![CDATA[AD cmdlets]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Examples]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[cmdlets]]></category>

		<guid isPermaLink="false">http://dmitrysotnikov.wordpress.com/?p=1647</guid>
		<description><![CDATA[Up to version 1.3, we used to have one cmdlet for computer accounts (namely Get-QADComputer) &#8211; now we have 6:

Get-QADComputer
New-QADComputer
Set-QADComputer
Enable-QADComputer
Disable-QADComputer
Reset-QADComputer

You can kind of guess what they do by their names, but let&#8217;s quickly go through them one by one and give a few quick examples.

Get-QADComputer

Retrieves AD computer account objects based on the criteria you specify. E.g. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&blog=867377&post=1647&subd=dmitrysotnikov&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Up to <a href="http://dmitrysotnikov.wordpress.com/2009/11/25/ad-cmdlets-1-3-rtmed/">version 1.3</a>, we used to have one cmdlet for computer accounts (namely <a title="Get-QADComputer" href="http://wiki.powergui.org/index.php/Get-QADComputer">Get-QADComputer</a>) &#8211; now we have 6:</p>
<ul>
<li><a title="Get-QADComputer" href="http://wiki.powergui.org/index.php/Get-QADComputer">Get-QADComputer</a></li>
<li><a title="New-QADComputer" href="http://wiki.powergui.org/index.php/New-QADComputer">New-QADComputer</a></li>
<li><a title="Set-QADComputer" href="http://wiki.powergui.org/index.php/Set-QADComputer">Set-QADComputer</a></li>
<li><a title="Set-QADComputer" href="http://wiki.powergui.org/index.php/Set-QADComputer"></a><a title="Enable-QADComputer" href="http://wiki.powergui.org/index.php/Enable-QADComputer">Enable-QADComputer</a></li>
<li><a title="Enable-QADComputer" href="http://wiki.powergui.org/index.php/Enable-QADComputer"></a><a title="Disable-QADComputer" href="http://wiki.powergui.org/index.php/Disable-QADComputer">Disable-QADComputer</a></li>
<li><a title="Disable-QADComputer" href="http://wiki.powergui.org/index.php/Disable-QADComputer"></a><a title="Reset-QADComputer" href="http://wiki.powergui.org/index.php/Reset-QADComputer">Reset-QADComputer</a></li>
</ul>
<p>You can kind of guess what they do by their names, but let&#8217;s quickly go through them one by one and give a few quick examples.</p>
<ul>
<li><a title="Get-QADComputer" href="http://wiki.powergui.org/index.php/Get-QADComputer">Get-QADComputer</a></li>
</ul>
<p>Retrieves AD computer account objects based on the criteria you specify. E.g. (anyone still running Vista? <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  )</p>
<p><code>Get-QADComputer spb* -OSName 'Windows Vista*' | Format-Table Name, ManagedBy</code></p>
<ul>
<li><a title="New-QADComputer" href="http://wiki.powergui.org/index.php/New-QADComputer">New-QADComputer</a></li>
</ul>
<p>Creates new computer account in AD (does not join the actual computer though) and sets the attributes you specify:  </p>
<p><code>New-QADComputer -Name 'LAB-SRV3' -SamAccountName 'LAB-SRV3' -ParentContainer 'CN=Computers,DC=lab,DC=local' -Location 'AMS/HQ/Building A'</code></p>
<ul>
<li><a title="Set-QADComputer" href="http://wiki.powergui.org/index.php/Set-QADComputer">Set-QADComputer</a></li>
</ul>
<p>Modifies AD computer account properties (can work in bulk when you pipe Get-QADComputer output into this one).  </p>
<p><code>Set-QADComputer 'quest.local/computers/Comp4' -ManagedBy 'QUEST\DSotnikov'</code></p>
<p> or </p>
<p> <code>Get-QADComputer spb* | Set-QADComputer -Location 'St. Petersburg'</code></p>
<ul>
<li><a title="Enable-QADComputer" href="http://wiki.powergui.org/index.php/Enable-QADComputer">Enable-QADComputer</a></li>
<li><a title="Enable-QADComputer" href="http://wiki.powergui.org/index.php/Enable-QADComputer"></a><a title="Disable-QADComputer" href="http://wiki.powergui.org/index.php/Disable-QADComputer">Disable-QADComputer</a></li>
</ul>
<p>Enable or disable one or multiple computer accounts:  </p>
<p><code>Enable-QADComputer 'CN=LAB-SRV1,CN=Computers,DC=dom,DC=local'</code> </p>
<p>or </p>
<p><code>Get-QADComputer -SearchRoot 'dom.local/labComputers' | Disable-QADComputer</code></p>
<ul>
<li><a title="Reset-QADComputer" href="http://wiki.powergui.org/index.php/Reset-QADComputer">Reset-QADComputer</a></li>
</ul>
<p>Reset a computer account in Active Directory. When resetting a computer account, you reset the secure channel between the computer that uses that account to join the domain and a domain controller in the domain.Resetting a computer account breaks that computer&#8217;s connection to the domain and requires it to rejoin the domain.</p>
<p><code>Reset-QADComputer 'CN=LAB-SRV1,CN=Computers,DC=dom,DC=local'</code> </p>
<p>More information can be found in <a href="http://wiki.powergui.org/index.php/QAD_cmdlets_reference">AD cmdlets online reference</a> and <a href="http://www.quest.com/QuestWebPowershellCmdletDwnldARS">PDF guide</a>. <a href="http://www.quest.com/powershell/activeroles-server.aspx">Download the new AD cmdlets now</a> and let us know what you think by posting to the <a href="http://powergui.org/forum.jspa?forumID=173">AD PowerShell discussion forum</a>!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmitrysotnikov.wordpress.com/1647/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmitrysotnikov.wordpress.com/1647/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmitrysotnikov.wordpress.com/1647/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmitrysotnikov.wordpress.com/1647/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmitrysotnikov.wordpress.com/1647/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmitrysotnikov.wordpress.com/1647/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmitrysotnikov.wordpress.com/1647/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmitrysotnikov.wordpress.com/1647/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmitrysotnikov.wordpress.com/1647/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmitrysotnikov.wordpress.com/1647/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&blog=867377&post=1647&subd=dmitrysotnikov&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dmitrysotnikov.wordpress.com/2009/11/27/new-cmdlets-to-manage-ad-computer-accounts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6ecc57e2c1be48013620bf85fb983dbf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmitrysotnikov</media:title>
		</media:content>
	</item>
		<item>
		<title>AD Cmdlets 1.3 RTMed</title>
		<link>http://dmitrysotnikov.wordpress.com/2009/11/25/ad-cmdlets-1-3-rtmed/</link>
		<comments>http://dmitrysotnikov.wordpress.com/2009/11/25/ad-cmdlets-1-3-rtmed/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 16:18:34 +0000</pubDate>
		<dc:creator>Dmitry Sotnikov</dc:creator>
				<category><![CDATA[AD]]></category>
		<category><![CDATA[AD cmdlets]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Release]]></category>
		<category><![CDATA[cmdlets]]></category>

		<guid isPermaLink="false">http://dmitrysotnikov.wordpress.com/?p=1645</guid>
		<description><![CDATA[Late last week we released to the web the latest version (1.3) of our free Active Directory cmdlets (also known as QAD-cmdlets, widely used by tens of thousands admins and compatible with more or less any version of Active Directory or ADAM/ADLDS).
You can read more about the cmdlets in this PDF guide, or online reference.
This [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&blog=867377&post=1645&subd=dmitrysotnikov&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Late last week we released to the web the latest version (1.3) of <a href="http://www.quest.com/activeroles-server/arms.aspx">our free Active Directory cmdlets</a> (also known as QAD-cmdlets, widely used by tens of thousands admins and compatible with more or less any version of Active Directory or ADAM/ADLDS).</p>
<p>You can read more about the cmdlets in <a href="http://www.quest.com/QuestWebPowershellCmdletDwnldARS">this PDF guide</a>, or <a href="http://wiki.powergui.org/index.php/QAD_cmdlets_reference">online reference</a>.</p>
<p>This is a significant update with some 14 new cmdlets, 24 new parameters, 43 enhanced ones, and a few bugs fixed (not that we had any really <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> )</p>
<p>Detailed What&#8217;s New information can be found on page 19 of the <a href="http://www.quest.com/QuestWebPowershellCmdletDwnldARS">PDF guide</a> and in my upcoming blog posts. <a href="http://www.quest.com/powershell/activeroles-server.aspx">Download the new AD cmdlets now</a> and let us know what you think by posting to the <a href="http://powergui.org/forum.jspa?forumID=173">AD PowerShell discussion forum</a>!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmitrysotnikov.wordpress.com/1645/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmitrysotnikov.wordpress.com/1645/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmitrysotnikov.wordpress.com/1645/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmitrysotnikov.wordpress.com/1645/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmitrysotnikov.wordpress.com/1645/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmitrysotnikov.wordpress.com/1645/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmitrysotnikov.wordpress.com/1645/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmitrysotnikov.wordpress.com/1645/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmitrysotnikov.wordpress.com/1645/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmitrysotnikov.wordpress.com/1645/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&blog=867377&post=1645&subd=dmitrysotnikov&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dmitrysotnikov.wordpress.com/2009/11/25/ad-cmdlets-1-3-rtmed/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6ecc57e2c1be48013620bf85fb983dbf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmitrysotnikov</media:title>
		</media:content>
	</item>
		<item>
		<title>Find users in too many groups</title>
		<link>http://dmitrysotnikov.wordpress.com/2009/10/12/find-users-in-too-many-groups/</link>
		<comments>http://dmitrysotnikov.wordpress.com/2009/10/12/find-users-in-too-many-groups/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 10:00:48 +0000</pubDate>
		<dc:creator>Dmitry Sotnikov</dc:creator>
				<category><![CDATA[AD]]></category>
		<category><![CDATA[AD cmdlets]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Examples]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[cmdlets]]></category>
		<category><![CDATA[one-liner]]></category>

		<guid isPermaLink="false">http://dmitrysotnikov.wordpress.com/?p=1575</guid>
		<description><![CDATA[Large Kerberos tokens (caused by too many groups listed in them) can be an issue in some environments (I&#8217;ve just had a similar trouble myself in an ADFS deployment). Luckily PowerShell is here to help. This quick script will list all users who are members of more than 75 groups:
$limit = 75
Get-QADUser -SizeLimit 0 -DontUseDefaultIncludedProperties [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&blog=867377&post=1575&subd=dmitrysotnikov&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Large Kerberos tokens (caused by too many groups listed in them) <a href="http://support.microsoft.com/kb/935744">can be an issue</a> in some environments (I&#8217;ve just had a similar trouble myself in an ADFS deployment). Luckily PowerShell is here to help. This quick script will list all users who are members of more than 75 groups:</p>
<pre><span style="color:#800080;">$limit</span><span style="color:#000000;"> </span><span style="color:#FF0000;">=</span><span style="color:#000000;"> </span><span style="color:#000000;">75</span><span style="color:#000000;">
</span><span style="color:#5F9EA0;font-weight:bold;">Get-QADUser</span><span style="color:#000000;"> </span><span style="color:#5F9EA0;font-style:italic;">-SizeLimit</span><span style="color:#000000;"> </span><span style="color:#000000;">0</span><span style="color:#000000;"> </span><span style="color:#5F9EA0;font-style:italic;">-DontUseDefaultIncludedProperties</span><span style="color:#000000;"> |
  </span><span style="color:#5F9EA0;font-weight:bold;">ForEach-Object</span><span style="color:#000000;"> {
    </span><span style="color:#800080;">$groups</span><span style="color:#000000;"> </span><span style="color:#FF0000;">=</span><span style="color:#000000;"> </span><span style="color:#5F9EA0;font-weight:bold;">Get-QADGroup</span><span style="color:#000000;"> </span><span style="color:#5F9EA0;font-style:italic;">-ContainsIndirectMember</span><span style="color:#000000;"> </span><span style="color:#800080;">$_</span><span style="color:#000000;">.DN </span><span style="color:#5F9EA0;font-style:italic;">-SizeLimit</span><span style="color:#000000;"> </span><span style="color:#800080;">$limit</span><span style="color:#000000;"> </span><span style="color:#5F9EA0;font-weight:bold;">`</span><span style="color:#000000;">
      </span><span style="color:#5F9EA0;font-style:italic;">-DontUseDefaultIncludedProperties</span><span style="color:#000000;"> </span><span style="color:#5F9EA0;font-style:italic;">-WarningAction</span><span style="color:#000000;"> </span><span style="color:#800000;">SilentlyContinue</span><span style="color:#000000;">
    </span><span style="color:#0000FF;">if</span><span style="color:#000000;"> (</span><span style="color:#800080;">$groups</span><span style="color:#000000;">.Count </span><span style="color:#FF0000;">-ge</span><span style="color:#000000;"> </span><span style="color:#800080;">$limit</span><span style="color:#000000;">) { </span><span style="color:#800080;">$_</span><span style="color:#000000;"> }
  }
</span></pre>
<p>Here&#8217;s a quick overview of what the script is doing:</p>
<ol>
<li>I assign the limit (<code>75</code>) to a variable. This is just for my convenience of reuse. E.g. I could turn this line into <code>param($limit = 75)</code> &#8211; and save this as a parameterized script or turn it into a function.</li>
<li>I user <code><a href="http://wiki.powergui.org/index.php/Get-QADUser">Get-QADUser</a></code> to retrieve all (<code>-SizeLimit 0</code>) user accounts from my current domain and I make sure to not retrieve any attributes along &#8211; so <a href="http://dmitrysotnikov.wordpress.com/2009/09/10/fastest-way-to-retrieve-ad-objects/">I save memory and improve performance</a> (<code>-DontUseDefaultIncludedProperties</code>)</li>
<li>For each user in my domain, I retrieve the first 75 (<code>-SizeLimit $limit</code>) groups to which the user belongs directly or through nesting (<code>-ContainsIndirectMember $_.DN</code>). There&#8217;s obviously no need to retrieve all groups &#8211; we just need to know if the user reached the limit. Again, we do not need any attributes (<code>-DontUseDefaultIncludedProperties</code>). I also tell PowerShell to not warn me if there are more groups than the size limit I specified (<code>-WarningAction SilentlyContinue</code>).</li>
<li>Finally, if indeed we reached the limit, I output that user object.</li>
</ol>
<p>You can obviously then just see the list on the screen or output it to CSV or HTML report.</p>
<p><span class="technoratitag">Tags: <a href="http://www.technorati.com/tag/AD" target="_blank" rel="tag" title="Link to Technorati Tag category for AD">AD</a>, <a href="http://www.technorati.com/tag/AD+cmdlets" target="_blank" rel="tag" title="Link to Technorati Tag category for AD cmdlets">AD cmdlets</a>, <a href="http://www.technorati.com/tag/Active+Directory" target="_blank" rel="tag" title="Link to Technorati Tag category for Active Directory">Active Directory</a>, <a href="http://www.technorati.com/tag/Examples" target="_blank" rel="tag" title="Link to Technorati Tag category for Examples">Examples</a>, <a href="http://www.technorati.com/tag/PowerShell" target="_blank" rel="tag" title="Link to Technorati Tag category for PowerShell">PowerShell</a>, <a href="http://www.technorati.com/tag/cmdlets" target="_blank" rel="tag" title="Link to Technorati Tag category for cmdlets">cmdlets</a>, <a href="http://www.technorati.com/tag/one-liner" target="_blank" rel="tag" title="Link to Technorati Tag category for one-liner">one-liner</a>, <a href="http://www.technorati.com/tag/oneliner" target="_blank" rel="tag" title="Link to Technorati Tag category for oneliner">oneliner</a></span><br /><span class="sociallinks">Add to: | <a href="http://technorati.com/faves?add=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F10%2F12%2Ffind%2Dusers%2Din%2Dtoo%2Dmany%2Dgroups%2F" target="_blank">Technorati</a> |  <a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F10%2F12%2Ffind%2Dusers%2Din%2Dtoo%2Dmany%2Dgroups%2F" target="_blank">Digg</a> |  <a href="http://del.icio.us/post?url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F10%2F12%2Ffind%2Dusers%2Din%2Dtoo%2Dmany%2Dgroups%2F;title=Find%20users%20in%20too%20many%20groups" target="_blank">del.icio.us</a> |  <a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?t=Find%20users%20in%20too%20many%20groups&amp;u=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F10%2F12%2Ffind%2Dusers%2Din%2Dtoo%2Dmany%2Dgroups%2F" target="_blank">Yahoo</a> |  <a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F10%2F12%2Ffind%2Dusers%2Din%2Dtoo%2Dmany%2Dgroups%2F&amp;Title=Find%20users%20in%20too%20many%20groups" target="_blank">BlinkList</a> |  <a href="http://www.spurl.net/spurl.php?url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F10%2F12%2Ffind%2Dusers%2Din%2Dtoo%2Dmany%2Dgroups%2F&amp;title=Find%20users%20in%20too%20many%20groups" target="_blank">Spurl</a> |  <a href="http://reddit.com/submit?url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F10%2F12%2Ffind%2Dusers%2Din%2Dtoo%2Dmany%2Dgroups%2F&amp;title=Find%20users%20in%20too%20many%20groups" target="_blank">reddit</a> |   <a href="http://www.furl.net/storeIt.jsp?t=Find%20users%20in%20too%20many%20groups&amp;u=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F10%2F12%2Ffind%2Dusers%2Din%2Dtoo%2Dmany%2Dgroups%2F" target="_blank">Furl</a> |  </span></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmitrysotnikov.wordpress.com/1575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmitrysotnikov.wordpress.com/1575/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmitrysotnikov.wordpress.com/1575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmitrysotnikov.wordpress.com/1575/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmitrysotnikov.wordpress.com/1575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmitrysotnikov.wordpress.com/1575/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmitrysotnikov.wordpress.com/1575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmitrysotnikov.wordpress.com/1575/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmitrysotnikov.wordpress.com/1575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmitrysotnikov.wordpress.com/1575/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&blog=867377&post=1575&subd=dmitrysotnikov&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dmitrysotnikov.wordpress.com/2009/10/12/find-users-in-too-many-groups/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6ecc57e2c1be48013620bf85fb983dbf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmitrysotnikov</media:title>
		</media:content>
	</item>
		<item>
		<title>Get a list of users&#8217; email addresses</title>
		<link>http://dmitrysotnikov.wordpress.com/2009/10/07/get-a-list-of-users-email-addresses/</link>
		<comments>http://dmitrysotnikov.wordpress.com/2009/10/07/get-a-list-of-users-email-addresses/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 15:04:35 +0000</pubDate>
		<dc:creator>Dmitry Sotnikov</dc:creator>
				<category><![CDATA[AD]]></category>
		<category><![CDATA[AD cmdlets]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Examples]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[cmdlets]]></category>
		<category><![CDATA[one-liner]]></category>

		<guid isPermaLink="false">http://dmitrysotnikov.wordpress.com/?p=1564</guid>
		<description><![CDATA[Here&#8217;s a one-liner to turn members of a group into a list of email addresses, separated by semicolon. I am using it every now and then when someone from our partners (which obviously do not have access to our address book) ask me for a list of folks to include in some discussions, or grant [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&blog=867377&post=1564&subd=dmitrysotnikov&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Here&#8217;s a one-liner to turn members of a group into a list of email addresses, separated by semicolon. I am using it every now and then when someone from our partners (which obviously do not have access to our address book) ask me for a list of folks to include in some discussions, or grant access to some resources, and so on.</p>
<p>Here&#8217;s the oneliner (for PowerShell v2):</p>
<pre><span style="color:#000000;">(</span><span style="color:#5F9EA0;font-weight:bold;">Get-QADGroupMember</span><span style="color:#000000;"> </span><span style="color:#800000;">MyGroupName</span><span style="color:#000000;"> </span><span style="color:#5F9EA0;font-style:italic;">-Type</span><span style="color:#000000;"> </span><span style="color:#800000;">user</span><span style="color:#000000;"> </span><span style="color:#5F9EA0;font-style:italic;">-Indirect</span><span style="color:#000000;"> |
    </span><span style="color:#5F9EA0;font-weight:bold;">Select</span><span style="color:#000000;"> </span><span style="color:#5F9EA0;font-style:italic;">-expand</span><span style="color:#000000;"> </span><span style="color:#800000;">Email</span><span style="color:#000000;">) </span><span style="color:#FF0000;">-join</span><span style="color:#000000;"> </span><span style="color:#800000;">'</span><span style="color:#800000;">;</span><span style="color:#800000;">'</span></pre>
<p>PowerShell v1 version has a slightly different syntax for join:</p>
<pre><span style="color:#000000;">[</span><span style="color:#008080;">string</span><span style="color:#000000;">]::</span><span style="color:#8B4513;">join</span><span style="color:#000000;">(</span><span style="color:#800000;">'</span><span style="color:#800000;">;</span><span style="color:#800000;">'</span><span style="color:#000000;">,
  (</span><span style="color:#5F9EA0;font-weight:bold;">Get-QADGroupMember</span><span style="color:#000000;"> </span><span style="color:#800000;">MyGroupName</span><span style="color:#000000;"> </span><span style="color:#5F9EA0;font-style:italic;">-Type</span><span style="color:#000000;"> </span><span style="color:#800000;">user</span><span style="color:#000000;"> </span><span style="color:#5F9EA0;font-style:italic;">-Indirect</span><span style="color:#000000;"> |
    </span><span style="color:#5F9EA0;font-weight:bold;">Select</span><span style="color:#000000;"> </span><span style="color:#5F9EA0;font-style:italic;">-expand</span><span style="color:#000000;"> </span><span style="color:#800000;">Email</span><span style="color:#000000;">))
</span></pre>
<p>And here&#8217;s a quick explanation of what it does:</p>
<ul>
<li>I use <code><a href="http://wiki.powergui.org/index.php/Get-QADGroupMember">Get-QADGroupMember</a></code> to retrieve all members of the group. Note that <code>-Indirect</code> parameter gives me all members of nested groups, and <code>-Type user</code> makes sure that nested groups themselves get excluded.</li>
<li>Then I am taking the collection of user objects and turn that into a collection of just one property of the objects (Email) using  <code>Select -expand</code>.</li>
<li>Finally I am using join to turn that collection into a string and using semicolon as separator.</li>
</ul>
<p>Hope this is useful.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmitrysotnikov.wordpress.com/1564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmitrysotnikov.wordpress.com/1564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmitrysotnikov.wordpress.com/1564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmitrysotnikov.wordpress.com/1564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmitrysotnikov.wordpress.com/1564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmitrysotnikov.wordpress.com/1564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmitrysotnikov.wordpress.com/1564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmitrysotnikov.wordpress.com/1564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmitrysotnikov.wordpress.com/1564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmitrysotnikov.wordpress.com/1564/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&blog=867377&post=1564&subd=dmitrysotnikov&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dmitrysotnikov.wordpress.com/2009/10/07/get-a-list-of-users-email-addresses/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6ecc57e2c1be48013620bf85fb983dbf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmitrysotnikov</media:title>
		</media:content>
	</item>
		<item>
		<title>List all empty OUs</title>
		<link>http://dmitrysotnikov.wordpress.com/2009/10/01/list-all-empty-ous/</link>
		<comments>http://dmitrysotnikov.wordpress.com/2009/10/01/list-all-empty-ous/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 10:00:03 +0000</pubDate>
		<dc:creator>Dmitry Sotnikov</dc:creator>
				<category><![CDATA[AD]]></category>
		<category><![CDATA[AD cmdlets]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Examples]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[cmdlets]]></category>
		<category><![CDATA[one-liner]]></category>

		<guid isPermaLink="false">http://dmitrysotnikov.wordpress.com/?p=1552</guid>
		<description><![CDATA[Here&#8217;s a one-liner you can use to quickly find empty organizational units in your Active Directory:
Get-QADObject -Type organizationalUnit -DontUseDefaultIncludedProperties &#124;
  where {
    -not ( Get-QADObject -SearchRoot $_.DN -DontUseDefaultIncludedProperties `
    -SearchScope OneLevel -SizeLimit 1 -WarningAction SilentlyContinue )
  }
A quick explanation of what I am doing here:

 I am [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&blog=867377&post=1552&subd=dmitrysotnikov&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Here&#8217;s a one-liner you can use to quickly find empty organizational units in your Active Directory:</p>
<pre><span style="color:#5F9EA0;font-weight:bold;">Get-QADObject</span><span style="color:#000000;"> </span><span style="color:#5F9EA0;font-style:italic;">-Type</span><span style="color:#000000;"> </span><span style="color:#800000;">organizationalUnit</span><span style="color:#000000;"> </span><span style="color:#5F9EA0;font-style:italic;">-DontUseDefaultIncludedProperties</span><span style="color:#000000;"> |
  </span><span style="color:#5F9EA0;font-weight:bold;">where</span><span style="color:#000000;"> {
    </span><span style="color:#FF0000;">-not</span><span style="color:#000000;"> ( </span><span style="color:#5F9EA0;font-weight:bold;">Get-QADObject</span><span style="color:#000000;"> </span><span style="color:#5F9EA0;font-style:italic;">-SearchRoot</span><span style="color:#000000;"> </span><span style="color:#800080;">$_</span><span style="color:#000000;">.DN </span><span style="color:#5F9EA0;font-style:italic;">-DontUseDefaultIncludedProperties</span><span style="color:#000000;"> </span><span style="color:#5F9EA0;font-weight:bold;">`</span><span style="color:#000000;">
    </span><span style="color:#5F9EA0;font-style:italic;">-SearchScope</span><span style="color:#000000;"> </span><span style="color:#800000;">OneLevel</span><span style="color:#000000;"> </span><span style="color:#5F9EA0;font-style:italic;">-SizeLimit</span><span style="color:#000000;"> </span><span style="color:#000000;">1</span><span style="color:#000000;"> </span><span style="color:#5F9EA0;font-style:italic;">-WarningAction</span><span style="color:#000000;"> </span><span style="color:#800000;">SilentlyContinue</span><span style="color:#000000;"> )
  }</span></pre>
<p>A quick explanation of what I am doing here:</p>
<ol>
<li> I am retrieving all <code>organizationalUnit </code>objects from my domain (and use the <a href="http://dmitrysotnikov.wordpress.com/2009/09/10/fastest-way-to-retrieve-ad-objects/"><code>-DontUseDefaultIncludedProperties</code> switch to save a few milliseconds</a> <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> )</li>
<li> Then for each of the OUs I am retrieving all AD objects that are in that OU by doing a <code>Get-QADObject</code> and limiting the search scope to the DN of the current OU.</li>
<li> Note that (<a href="http://dmitrysotnikov.wordpress.com/2009/09/08/find-large-ad-groups/">like we did when looking for large groups</a>) I am using the <code>-SizeLimit</code> parameter to see if I can get 1 item in the call (all I need is to learn whether there is <em>anything</em> in the OU &#8211; I don&#8217;t need the whole list) &#8211; which obviously makes the whole script magnitudes of time faster. I use -SearchScope </li>
<li> Based on Kirk&#8217;s recommendation I am using <code>-SearchScope OneLevel</code> to exclude the OU itself.</li>
<li> I am using -not operator so I get only the OUs for which this Get-QADObject evaluates to <code>$null</code> (nothing found) and thus <code>-not $null</code> evaluates to <code>$true</code>.</li>
</ol>
<p>P.S. This is the code I was using initially, which I then corrected based on Kirk&#8217;s comments below:</p>
<p><code>$emptyOUs = Get-QADObject -Type organizationalUnit -DontUseDefaultIncludedProperties | where {(Get-QADObject -SearchRoot $_.DN -SizeLimit 2 -DontUseDefaultIncludedProperties).Count -lt 2}</code></p>
<p><span class="technoratitag">Tags: <a href="http://www.technorati.com/tag/AD" target="_blank" rel="tag" title="Link to Technorati Tag category for AD">AD</a>, <a href="http://www.technorati.com/tag/AD+cmdlets" target="_blank" rel="tag" title="Link to Technorati Tag category for AD cmdlets">AD cmdlets</a>, <a href="http://www.technorati.com/tag/Active+Directory" target="_blank" rel="tag" title="Link to Technorati Tag category for Active Directory">Active Directory</a>, <a href="http://www.technorati.com/tag/Examples" target="_blank" rel="tag" title="Link to Technorati Tag category for Examples">Examples</a>, <a href="http://www.technorati.com/tag/PowerShell" target="_blank" rel="tag" title="Link to Technorati Tag category for PowerShell">PowerShell</a>, <a href="http://www.technorati.com/tag/cmdlets" target="_blank" rel="tag" title="Link to Technorati Tag category for cmdlets">cmdlets</a>, <a href="http://www.technorati.com/tag/one-liner" target="_blank" rel="tag" title="Link to Technorati Tag category for one-liner">one-liner</a></span><br /><span class="sociallinks">Add to: | <a href="http://technorati.com/faves?add=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F10%2F01%2Flist%2Dall%2Dempty%2Dous%2F" target="_blank">Technorati</a> |  <a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F10%2F01%2Flist%2Dall%2Dempty%2Dous%2F" target="_blank">Digg</a> |  <a href="http://del.icio.us/post?url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F10%2F01%2Flist%2Dall%2Dempty%2Dous%2F;title=List%20all%20empty%20OUs" target="_blank">del.icio.us</a> |  <a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?t=List%20all%20empty%20OUs&amp;u=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F10%2F01%2Flist%2Dall%2Dempty%2Dous%2F" target="_blank">Yahoo</a> |  <a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F10%2F01%2Flist%2Dall%2Dempty%2Dous%2F&amp;Title=List%20all%20empty%20OUs" target="_blank">BlinkList</a> |  <a href="http://www.spurl.net/spurl.php?url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F10%2F01%2Flist%2Dall%2Dempty%2Dous%2F&amp;title=List%20all%20empty%20OUs" target="_blank">Spurl</a> |  <a href="http://reddit.com/submit?url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F10%2F01%2Flist%2Dall%2Dempty%2Dous%2F&amp;title=List%20all%20empty%20OUs" target="_blank">reddit</a> |   <a href="http://www.furl.net/storeIt.jsp?t=List%20all%20empty%20OUs&amp;u=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F10%2F01%2Flist%2Dall%2Dempty%2Dous%2F" target="_blank">Furl</a> |  </span></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmitrysotnikov.wordpress.com/1552/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmitrysotnikov.wordpress.com/1552/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmitrysotnikov.wordpress.com/1552/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmitrysotnikov.wordpress.com/1552/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmitrysotnikov.wordpress.com/1552/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmitrysotnikov.wordpress.com/1552/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmitrysotnikov.wordpress.com/1552/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmitrysotnikov.wordpress.com/1552/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmitrysotnikov.wordpress.com/1552/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmitrysotnikov.wordpress.com/1552/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&blog=867377&post=1552&subd=dmitrysotnikov&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dmitrysotnikov.wordpress.com/2009/10/01/list-all-empty-ous/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6ecc57e2c1be48013620bf85fb983dbf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmitrysotnikov</media:title>
		</media:content>
	</item>
		<item>
		<title>Skype for administrators</title>
		<link>http://dmitrysotnikov.wordpress.com/2009/09/21/skype-for-administrators/</link>
		<comments>http://dmitrysotnikov.wordpress.com/2009/09/21/skype-for-administrators/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 10:00:18 +0000</pubDate>
		<dc:creator>Dmitry Sotnikov</dc:creator>
				<category><![CDATA[AD]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[Exchange]]></category>
		<category><![CDATA[PowerGUI]]></category>
		<category><![CDATA[PowerPack]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Skype]]></category>

		<guid isPermaLink="false">http://dmitrysotnikov.wordpress.com/?p=1539</guid>
		<description><![CDATA[Call any user in Active Directory or Exchange right from your administrative console, with a single click dial into any conference call (with participant passcode dialed for you  ) &#8211; all of that is possible with the latest extension for PowerGUI.
PowerGUI Skype PowerPack adds Call buttons for all user accounts and mailboxes, as well [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&blog=867377&post=1539&subd=dmitrysotnikov&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Call any user in Active Directory or Exchange right from your administrative console, with a single click dial into any conference call (with participant passcode dialed for you <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ) &#8211; all of that is possible with the latest extension for <a href="http://powergui.org">PowerGUI</a>.</p>
<p><a href="http://powergui.org/entry.jspa?categoryID=47&amp;externalID=2491">PowerGUI Skype PowerPack</a> adds <strong>Call</strong> buttons for all user accounts and mailboxes, as well as people in your corporate organizational chart. In addition to this you can obviously call any of your <a href="http://www.skype.com">Skype</a> contacts or any conference call appointments listed in your Outlook.</p>
<p>Check out this 7-minute demo <a href="http://www.youtube.com/watch?v=OasTRCVVDpo">here</a> (highly recommended to watch in HD and full screen):</p>
<p><span style="text-align:center; display: block;"><a href="http://dmitrysotnikov.wordpress.com/2009/09/21/skype-for-administrators/"><img src="http://img.youtube.com/vi/OasTRCVVDpo/2.jpg" alt="" /></a></span></p>
<p>As always, all the code behind any nodes and actions can be found in their properties, so you can learn how this actually works, modify the pack to suite your needs or extend it to add calling capabilities to whichever other systems you are managing!</p>
<p><a href="http://www.shafqatahmed.com/2009/05/skype-automation-in-powershell-dont-have-to-dial-conference-codes-in-anymore.html">This blog post by Shafqat Ahmed</a> helped me a lot when I started working on the PowerPack. My scripts in the pack are basically enhancements built on top of his excellent post.</p>
<p>Download Skype PowerPack <a href="http://powergui.org/entry.jspa?categoryID=47&amp;externalID=2491">here</a> and let us know what you think.</p>
<p><span class="technoratitag">Tags: <a href="http://www.technorati.com/tag/AD" target="_blank" rel="tag" title="Link to Technorati Tag category for AD">AD</a>, <a href="http://www.technorati.com/tag/Active+Directory" target="_blank" rel="tag" title="Link to Technorati Tag category for Active Directory">Active Directory</a>, <a href="http://www.technorati.com/tag/Demo" target="_blank" rel="tag" title="Link to Technorati Tag category for Demo">Demo</a>, <a href="http://www.technorati.com/tag/Exchange" target="_blank" rel="tag" title="Link to Technorati Tag category for Exchange">Exchange</a>, <a href="http://www.technorati.com/tag/PowerGUI" target="_blank" rel="tag" title="Link to Technorati Tag category for PowerGUI">PowerGUI</a>, <a href="http://www.technorati.com/tag/PowerPack" target="_blank" rel="tag" title="Link to Technorati Tag category for PowerPack">PowerPack</a>, <a href="http://www.technorati.com/tag/PowerShell" target="_blank" rel="tag" title="Link to Technorati Tag category for PowerShell">PowerShell</a>, <a href="http://www.technorati.com/tag/Skype" target="_blank" rel="tag" title="Link to Technorati Tag category for Skype">Skype</a></span><br /><span class="sociallinks">Add to: | <a href="http://technorati.com/faves?add=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F09%2F21%2Fskype%2Dfor%2Dadministrators%2F" target="_blank">Technorati</a> |  <a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F09%2F21%2Fskype%2Dfor%2Dadministrators%2F" target="_blank">Digg</a> |  <a href="http://del.icio.us/post?url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F09%2F21%2Fskype%2Dfor%2Dadministrators%2F;title=Skype%20for%20administrators" target="_blank">del.icio.us</a> |  <a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?t=Skype%20for%20administrators&amp;u=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F09%2F21%2Fskype%2Dfor%2Dadministrators%2F" target="_blank">Yahoo</a> |  <a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F09%2F21%2Fskype%2Dfor%2Dadministrators%2F&amp;Title=Skype%20for%20administrators" target="_blank">BlinkList</a> |  <a href="http://www.spurl.net/spurl.php?url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F09%2F21%2Fskype%2Dfor%2Dadministrators%2F&amp;title=Skype%20for%20administrators" target="_blank">Spurl</a> |  <a href="http://reddit.com/submit?url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F09%2F21%2Fskype%2Dfor%2Dadministrators%2F&amp;title=Skype%20for%20administrators" target="_blank">reddit</a> |   <a href="http://www.furl.net/storeIt.jsp?t=Skype%20for%20administrators&amp;u=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F09%2F21%2Fskype%2Dfor%2Dadministrators%2F" target="_blank">Furl</a> |  </span></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmitrysotnikov.wordpress.com/1539/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmitrysotnikov.wordpress.com/1539/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmitrysotnikov.wordpress.com/1539/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmitrysotnikov.wordpress.com/1539/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmitrysotnikov.wordpress.com/1539/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmitrysotnikov.wordpress.com/1539/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmitrysotnikov.wordpress.com/1539/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmitrysotnikov.wordpress.com/1539/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmitrysotnikov.wordpress.com/1539/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmitrysotnikov.wordpress.com/1539/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&blog=867377&post=1539&subd=dmitrysotnikov&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dmitrysotnikov.wordpress.com/2009/09/21/skype-for-administrators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6ecc57e2c1be48013620bf85fb983dbf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmitrysotnikov</media:title>
		</media:content>

		<media:content url="http://img.youtube.com/vi/OasTRCVVDpo/2.jpg" medium="image" />
	</item>
		<item>
		<title>Adding Direct Reports action</title>
		<link>http://dmitrysotnikov.wordpress.com/2009/09/14/adding-direct-reports-action/</link>
		<comments>http://dmitrysotnikov.wordpress.com/2009/09/14/adding-direct-reports-action/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 10:34:13 +0000</pubDate>
		<dc:creator>Dmitry Sotnikov</dc:creator>
				<category><![CDATA[AD]]></category>
		<category><![CDATA[AD cmdlets]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Blogosphere]]></category>
		<category><![CDATA[PowerGUI]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[cmdlets]]></category>

		<guid isPermaLink="false">http://dmitrysotnikov.wordpress.com/?p=1520</guid>
		<description><![CDATA[Here&#8217;s my quick addition to Kamran&#8217;s &#8220;How to export data from Active Directory using the free PowerGUI tool&#8220;:
If you might need to find users managed by someone more than once, there are a couple of ways you can make this simpler for your self:
A. Download and install free Org Chart powerpack, or
B. Follow these instructions [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&blog=867377&post=1520&subd=dmitrysotnikov&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Here&#8217;s my quick addition to Kamran&#8217;s &#8220;<a href="http://activedirectorytools.com/archives/how-to-export-data-from-active-directory-using-the-free-powergui-tool/">How to export data from Active Directory using the free PowerGUI tool</a>&#8220;:</p>
<p>If you might need to find users managed by someone more than once, there are a couple of ways you can make this simpler for your self:</p>
<p>A. Download and install free <a href="http://dmitrysotnikov.wordpress.com/2009/07/01/build-org-charts-with-powershell/">Org Chart powerpack</a>, or</p>
<p>B. Follow these instructions to add a Direct Reports button to PowerGUI admin console:</p>
<p>1. Start <strong>PowerGUI </strong>admin console and browse to <strong>Active Directory / Users</strong>.</p>
<p>2. In the right-hand pane, right-click the category to which you want to add the action and pick <strong>New / Script Action</strong> from the shortcut menu.</p>
<p><img src="http://dmitrysotnikov.files.wordpress.com/2009/09/new-script-action.png?w=351&#038;h=97" alt="new-script-action" title="new-script-action" width="351" height="97" class="aligncenter size-full wp-image-1521" /></p>
<p>3. In the <strong>New Action</strong> dialog box, type in the action name (e.g. <em>Direct Reports</em>), and script:</p>
<pre><span style="color:#800080;">$input</span><span style="color:#000000;"> | </span><span style="color:#5F9EA0;font-weight:bold;">ForEach-Object</span><span style="color:#000000;"> {
    </span><span style="color:#5F9EA0;font-weight:bold;">Get-QADUser</span><span style="color:#000000;"> </span><span style="color:#5F9EA0;font-style:italic;">-Manager</span><span style="color:#000000;"> </span><span style="color:#800080;">$_</span><span style="color:#000000;">
}</span></pre>
<p>(The script is quite trivial: for each user account currently selected in the PowerGUI grid, we get the list of AD users which have this object specified as <code>Manager</code>).</p>
<p><img src="http://dmitrysotnikov.files.wordpress.com/2009/09/direct-reports.png?w=403&#038;h=332" alt="direct-reports" title="direct-reports" width="403" height="332" class="aligncenter size-full wp-image-1522" /></p>
<p>3. On that same dialog box, click the <strong>Display Configuration</strong> button, and then in the <strong>Display results</strong> group, select the <strong>Display the results in a nested view</strong> option. </p>
<p>This tells PowerGUI that your action outputs objects to the grid (which it does &#8211; we need to see the reports selected user has!)</p>
<p><a href="http://dmitrysotnikov.files.wordpress.com/2009/09/nested-view.png"><img src="http://dmitrysotnikov.files.wordpress.com/2009/09/nested-view.png?w=266&#038;h=300" alt="nested-view" title="nested-view" width="266" height="300" class="aligncenter size-medium wp-image-1523" /></a></p>
<p>4. That&#8217;s it! Click <strong>OK </strong>on both dialog boxes, select the user account whose reports you need to see, and click your newly added <em>Direct Reports</em> action.</p>
<p>Big thanks to Kamran for <a href="http://activedirectorytools.com/archives/how-to-export-data-from-active-directory-using-the-free-powergui-tool/">posting his original tip and video</a>.</p>
<p><span class="technoratitag">Tags: <a href="http://www.technorati.com/tag/AD" target="_blank" rel="tag" title="Link to Technorati Tag category for AD">AD</a>, <a href="http://www.technorati.com/tag/AD+cmdlets" target="_blank" rel="tag" title="Link to Technorati Tag category for AD cmdlets">AD cmdlets</a>, <a href="http://www.technorati.com/tag/Active+Directory" target="_blank" rel="tag" title="Link to Technorati Tag category for Active Directory">Active Directory</a>, <a href="http://www.technorati.com/tag/Blogosphere" target="_blank" rel="tag" title="Link to Technorati Tag category for Blogosphere">Blogosphere</a>, <a href="http://www.technorati.com/tag/PowerGUI" target="_blank" rel="tag" title="Link to Technorati Tag category for PowerGUI">PowerGUI</a>, <a href="http://www.technorati.com/tag/PowerShell" target="_blank" rel="tag" title="Link to Technorati Tag category for PowerShell">PowerShell</a>, <a href="http://www.technorati.com/tag/cmdlets" target="_blank" rel="tag" title="Link to Technorati Tag category for cmdlets">cmdlets</a></span><br /><span class="sociallinks">Add to: | <a href="http://technorati.com/faves?add=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F09%2F14%2Fadding%2Ddirect%2Dreports%2Daction%2F" target="_blank">Technorati</a> |  <a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F09%2F14%2Fadding%2Ddirect%2Dreports%2Daction%2F" target="_blank">Digg</a> |  <a href="http://del.icio.us/post?url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F09%2F14%2Fadding%2Ddirect%2Dreports%2Daction%2F;title=Adding%20Direct%20Reports%20action" target="_blank">del.icio.us</a> |  <a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?t=Adding%20Direct%20Reports%20action&amp;u=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F09%2F14%2Fadding%2Ddirect%2Dreports%2Daction%2F" target="_blank">Yahoo</a> |  <a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F09%2F14%2Fadding%2Ddirect%2Dreports%2Daction%2F&amp;Title=Adding%20Direct%20Reports%20action" target="_blank">BlinkList</a> |  <a href="http://www.spurl.net/spurl.php?url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F09%2F14%2Fadding%2Ddirect%2Dreports%2Daction%2F&amp;title=Adding%20Direct%20Reports%20action" target="_blank">Spurl</a> |  <a href="http://reddit.com/submit?url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F09%2F14%2Fadding%2Ddirect%2Dreports%2Daction%2F&amp;title=Adding%20Direct%20Reports%20action" target="_blank">reddit</a> |   <a href="http://www.furl.net/storeIt.jsp?t=Adding%20Direct%20Reports%20action&amp;u=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F09%2F14%2Fadding%2Ddirect%2Dreports%2Daction%2F" target="_blank">Furl</a> |  </span></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmitrysotnikov.wordpress.com/1520/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmitrysotnikov.wordpress.com/1520/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmitrysotnikov.wordpress.com/1520/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmitrysotnikov.wordpress.com/1520/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmitrysotnikov.wordpress.com/1520/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmitrysotnikov.wordpress.com/1520/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmitrysotnikov.wordpress.com/1520/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmitrysotnikov.wordpress.com/1520/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmitrysotnikov.wordpress.com/1520/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmitrysotnikov.wordpress.com/1520/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&blog=867377&post=1520&subd=dmitrysotnikov&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dmitrysotnikov.wordpress.com/2009/09/14/adding-direct-reports-action/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6ecc57e2c1be48013620bf85fb983dbf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmitrysotnikov</media:title>
		</media:content>

		<media:content url="http://dmitrysotnikov.files.wordpress.com/2009/09/new-script-action.png" medium="image">
			<media:title type="html">new-script-action</media:title>
		</media:content>

		<media:content url="http://dmitrysotnikov.files.wordpress.com/2009/09/direct-reports.png" medium="image">
			<media:title type="html">direct-reports</media:title>
		</media:content>

		<media:content url="http://dmitrysotnikov.files.wordpress.com/2009/09/nested-view.png?w=266" medium="image">
			<media:title type="html">nested-view</media:title>
		</media:content>
	</item>
		<item>
		<title>Fastest way to retrieve AD objects</title>
		<link>http://dmitrysotnikov.wordpress.com/2009/09/10/fastest-way-to-retrieve-ad-objects/</link>
		<comments>http://dmitrysotnikov.wordpress.com/2009/09/10/fastest-way-to-retrieve-ad-objects/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 20:01:08 +0000</pubDate>
		<dc:creator>Dmitry Sotnikov</dc:creator>
				<category><![CDATA[AD]]></category>
		<category><![CDATA[AD cmdlets]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Examples]]></category>
		<category><![CDATA[KB]]></category>
		<category><![CDATA[Knowledge Base]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://dmitrysotnikov.wordpress.com/?p=1513</guid>
		<description><![CDATA[DontUseDefaultIncludedProperties is the AD cmdlets parameter you need when you want to get AD objects fast without extra properties you do not need. For example, I have just used it in my script to locate the largest groups in our Active Directory. Let&#8217;s talk about how effective it really is and how it works under [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&blog=867377&post=1513&subd=dmitrysotnikov&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><code>DontUseDefaultIncludedProperties</code> is the AD cmdlets parameter you need when you want to get AD objects fast without extra properties you do not need. For example, I have just used it in my script to <a href="http://dmitrysotnikov.wordpress.com/2009/09/08/find-large-ad-groups/">locate the largest groups in our Active Directory</a>. Let&#8217;s talk about how effective it really is and how it works under the covers.</p>
<p>First, of all, let me prove that it is indeed very efficient. Here&#8217;s the same Get-QADUser run 100 times with and without the parameter:</p>
<p><code>[PS] C:\&gt;Measure-Command { for ($i=0;$i -lt 100;$i++) { $a = Get-QADUser -SamAccountName dsotnikov -<strong>DontUseDefaultIncludedProperties</strong> } }</code><br />
<code></code><br />
<code>...</code><br />
<code>Seconds           : 3</code><br />
<code>Milliseconds      : 951</code><br />
<code>...</code><br />
<code></code><br />
<code></code><br />
<code>[PS] C:\&gt;Measure-Command { for ($i=0;$i -lt 100;$i++) { $a = Get-QADUser -SamAccountName dsotnikov } }</code><br />
<code></code><br />
<code>...</code><br />
<code>Seconds           : 7</code><br />
<code>Milliseconds      : 526</code><br />
<code>...</code></p>
<p>That&#8217;s twice as fast with the parameter than it is without it!</p>
<p>Why? Because <code>DontUseDefaultIncludedProperties</code> makes the cmdlet only retrieve 2 attributes: <code>distinguishedName</code> и <code>objectClass</code>, whereas the cmdlet without it will go get quite a few other properties.</p>
<p>You can easily see which attributes got retrieved by running:<br />
<code>$a = Get-QADUser -SamAccountName dsotnikov -DontUseDefaultIncludedProperties</code><br />
<code>$a.Cache.AttributesInCache</code></p>
<p>The interesting thing is that the cmdlet is even smarter with subsequent use of the object. For most properties (to be specific, for all regular .NET properties of the object but not PowerShell dynamic NoteProperties), we will go and retrieve the property once you request it later on. E.g. this will actually work and give you the account description:</p>
<p><code>$a = Get-QADUser -SamAccountName dsotnikov -DontUseDefaultIncludedProperties</code><br />
<code>$a.Description</code></p>
<p>And this will retrieve a whole bunch of attributes:<br />
<code>Get-QADUser -SamAccountName dsotnikov -DontUseDefaultIncludedProperties | Format-List *</code></p>
<p>You can obviously keep using <code>$a.Cache.AttributesInCache</code> to check which ones we retrieve.</p>
<p>Pretty cool, isn&#8217;t it?</p>
<p>The only other thing I would note is the difference between:</p>
<p><code>Get-QADUser <strong>-SamAccountName </strong>dsotnikov -DontUseDefaultIncludedProperties</code></p>
<p>and</p>
<p><code>Get-QADUser dsotnikov -DontUseDefaultIncludedProperties</code></p>
<p>The former is way more efficient than the latter because the <code>-SamAccountName</code> parameter (or any other parameter besides the generic implied <code>-Identity</code>) lets us optimize the query specifically to search by that attribute rather than do the <a href="http://support.microsoft.com/kb/243299">Ambiguous Name Resolution</a> which we use otherwise. Be specific in your parameters and we will give you the fastest results!</p>
<p><span class="technoratitag">Tags: <a href="http://www.technorati.com/tag/AD" target="_blank" rel="tag" title="Link to Technorati Tag category for AD">AD</a>, <a href="http://www.technorati.com/tag/AD+cmdlets" target="_blank" rel="tag" title="Link to Technorati Tag category for AD cmdlets">AD cmdlets</a>, <a href="http://www.technorati.com/tag/Active+Directory" target="_blank" rel="tag" title="Link to Technorati Tag category for Active Directory">Active Directory</a>, <a href="http://www.technorati.com/tag/Examples" target="_blank" rel="tag" title="Link to Technorati Tag category for Examples">Examples</a>, <a href="http://www.technorati.com/tag/KB" target="_blank" rel="tag" title="Link to Technorati Tag category for KB">KB</a>, <a href="http://www.technorati.com/tag/Knowledge+Base" target="_blank" rel="tag" title="Link to Technorati Tag category for Knowledge Base">Knowledge Base</a>, <a href="http://www.technorati.com/tag/PowerShell" target="_blank" rel="tag" title="Link to Technorati Tag category for PowerShell">PowerShell</a></span><br /><span class="sociallinks">Add to: | <a href="http://technorati.com/faves?add=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F09%2F10%2Ffastest%2Dway%2Dto%2Dretrieve%2Dad%2Dobjects%2F" target="_blank">Technorati</a> |  <a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F09%2F10%2Ffastest%2Dway%2Dto%2Dretrieve%2Dad%2Dobjects%2F" target="_blank">Digg</a> |  <a href="http://del.icio.us/post?url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F09%2F10%2Ffastest%2Dway%2Dto%2Dretrieve%2Dad%2Dobjects%2F;title=Fastest%20way%20to%20retrieve%20AD%20objects" target="_blank">del.icio.us</a> |  <a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?t=Fastest%20way%20to%20retrieve%20AD%20objects&amp;u=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F09%2F10%2Ffastest%2Dway%2Dto%2Dretrieve%2Dad%2Dobjects%2F" target="_blank">Yahoo</a> |  <a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F09%2F10%2Ffastest%2Dway%2Dto%2Dretrieve%2Dad%2Dobjects%2F&amp;Title=Fastest%20way%20to%20retrieve%20AD%20objects" target="_blank">BlinkList</a> |  <a href="http://www.spurl.net/spurl.php?url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F09%2F10%2Ffastest%2Dway%2Dto%2Dretrieve%2Dad%2Dobjects%2F&amp;title=Fastest%20way%20to%20retrieve%20AD%20objects" target="_blank">Spurl</a> |  <a href="http://reddit.com/submit?url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F09%2F10%2Ffastest%2Dway%2Dto%2Dretrieve%2Dad%2Dobjects%2F&amp;title=Fastest%20way%20to%20retrieve%20AD%20objects" target="_blank">reddit</a> |   <a href="http://www.furl.net/storeIt.jsp?t=Fastest%20way%20to%20retrieve%20AD%20objects&amp;u=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F09%2F10%2Ffastest%2Dway%2Dto%2Dretrieve%2Dad%2Dobjects%2F" target="_blank">Furl</a> |  </span></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmitrysotnikov.wordpress.com/1513/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmitrysotnikov.wordpress.com/1513/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmitrysotnikov.wordpress.com/1513/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmitrysotnikov.wordpress.com/1513/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmitrysotnikov.wordpress.com/1513/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmitrysotnikov.wordpress.com/1513/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmitrysotnikov.wordpress.com/1513/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmitrysotnikov.wordpress.com/1513/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmitrysotnikov.wordpress.com/1513/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmitrysotnikov.wordpress.com/1513/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&blog=867377&post=1513&subd=dmitrysotnikov&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dmitrysotnikov.wordpress.com/2009/09/10/fastest-way-to-retrieve-ad-objects/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6ecc57e2c1be48013620bf85fb983dbf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmitrysotnikov</media:title>
		</media:content>
	</item>
		<item>
		<title>Find large AD groups</title>
		<link>http://dmitrysotnikov.wordpress.com/2009/09/08/find-large-ad-groups/</link>
		<comments>http://dmitrysotnikov.wordpress.com/2009/09/08/find-large-ad-groups/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 15:57:15 +0000</pubDate>
		<dc:creator>Dmitry Sotnikov</dc:creator>
				<category><![CDATA[AD]]></category>
		<category><![CDATA[AD cmdlets]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Examples]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[cmdlets]]></category>

		<guid isPermaLink="false">http://dmitrysotnikov.wordpress.com/?p=1511</guid>
		<description><![CDATA[Here&#8217;s a quick script which I wrote yesterday for one of our professional services engineers. Basically they wanted to give customer a report for large groups, i.e. groups with more than certain number of user accounts including the ones in nested groups.
This turned out to be very straight-forward with QAD cmdlets.
The script is below:
function Get-LargeADGroup [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&blog=867377&post=1511&subd=dmitrysotnikov&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Here&#8217;s a quick script which I wrote yesterday for one of our professional services engineers. Basically they wanted to give customer a report for large groups, i.e. groups with more than certain number of user accounts including the ones in nested groups.</p>
<p>This turned out to be very straight-forward with <a href="http://www.quest.com/activeroles-server/arms.aspx">QAD cmdlets</a>.</p>
<p>The script is below:</p>
<pre><span style="color:#0000FF;">function</span><span style="color:#000000;"> </span><span style="color:#5F9EA0;">Get-LargeADGroup</span><span style="color:#000000;"> {
</span><span style="color:#0000FF;">param</span><span style="color:#000000;">(</span><span style="color:#800080;">$limit</span><span style="color:#000000;"> </span><span style="color:#FF0000;">=</span><span style="color:#000000;"> </span><span style="color:#000000;">75</span><span style="color:#000000;">)

 </span><span style="color:#5F9EA0;font-weight:bold;">Get-QADGroup</span><span style="color:#000000;"> | </span><span style="color:#5F9EA0;font-weight:bold;">Foreach-Object</span><span style="color:#000000;"> {
   </span><span style="color:#800080;">$members</span><span style="color:#000000;"> </span><span style="color:#FF0000;">=</span><span style="color:#000000;"> </span><span style="color:#800080;">$_</span><span style="color:#000000;"> |
           </span><span style="color:#5F9EA0;font-weight:bold;">Get-QADGroupMember</span><span style="color:#000000;"> </span><span style="color:#5F9EA0;font-style:italic;">-Indirect</span><span style="color:#000000;"> </span><span style="color:#5F9EA0;font-style:italic;">-Type</span><span style="color:#000000;"> </span><span style="color:#800000;">'</span><span style="color:#800000;">user</span><span style="color:#800000;">'</span><span style="color:#000000;"> </span><span style="color:#5F9EA0;font-weight:bold;">`</span><span style="color:#000000;">
              </span><span style="color:#5F9EA0;font-style:italic;">-DontUseDefaultIncludedProperties</span><span style="color:#000000;"> </span><span style="color:#5F9EA0;font-weight:bold;">`</span><span style="color:#000000;">
              </span><span style="color:#5F9EA0;font-style:italic;">-SizeLimit</span><span style="color:#000000;"> (</span><span style="color:#800080;">$limit</span><span style="color:#FF0000;">+</span><span style="color:#000000;">1</span><span style="color:#000000;">) </span><span style="color:#5F9EA0;font-style:italic;">-WarningAction</span><span style="color:#000000;"> </span><span style="color:#800000;">SilentlyContinue</span><span style="color:#000000;">
   </span><span style="color:#0000FF;">if</span><span style="color:#000000;"> ( (</span><span style="color:#800080;">$members</span><span style="color:#000000;"> </span><span style="color:#FF0000;">-ne</span><span style="color:#000000;"> </span><span style="color:#800080;">$null</span><span style="color:#000000;">) </span><span style="color:#FF0000;">-and</span><span style="color:#000000;">
        (</span><span style="color:#800080;">$members</span><span style="color:#000000;">.gettype().Name </span><span style="color:#FF0000;">-eq</span><span style="color:#000000;"> </span><span style="color:#800000;">'</span><span style="color:#800000;">Object[]</span><span style="color:#800000;">'</span><span style="color:#000000;">) </span><span style="color:#FF0000;">-and</span><span style="color:#000000;">
        (</span><span style="color:#800080;">$members</span><span style="color:#000000;">.Count </span><span style="color:#FF0000;">-ge</span><span style="color:#000000;"> </span><span style="color:#800080;">$limit</span><span style="color:#000000;">)) {
     </span><span style="color:#800080;">$_</span><span style="color:#000000;">
   }
 }
}

</span><span style="color:#008000;">#</span><span style="color:#008000;">Usage</span><span style="color:#008000;">
</span><span style="color:#5F9EA0;">Get-LargeADGroup</span><span style="color:#000000;"> -limit </span><span style="color:#000000;">75</span><span style="color:#000000;"> | </span><span style="color:#5F9EA0;font-weight:bold;">Select</span><span style="color:#000000;"> Name, </span><span style="color:#800000;">DN</span><span style="color:#000000;"> | </span><span style="color:#5F9EA0;font-weight:bold;">Export-Csv</span><span style="color:#000000;"> </span><span style="color:#800000;">c:\largegroups.csv</span></pre>
<p>One trick worth pointing out is the use of -SizeLimit to not retrieve all members of the group &#8211; after all I just need to know if there is more than certain number of them.</p>
<p>Hope this helps! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmitrysotnikov.wordpress.com/1511/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmitrysotnikov.wordpress.com/1511/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmitrysotnikov.wordpress.com/1511/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmitrysotnikov.wordpress.com/1511/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmitrysotnikov.wordpress.com/1511/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmitrysotnikov.wordpress.com/1511/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmitrysotnikov.wordpress.com/1511/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmitrysotnikov.wordpress.com/1511/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmitrysotnikov.wordpress.com/1511/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmitrysotnikov.wordpress.com/1511/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&blog=867377&post=1511&subd=dmitrysotnikov&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dmitrysotnikov.wordpress.com/2009/09/08/find-large-ad-groups/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6ecc57e2c1be48013620bf85fb983dbf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmitrysotnikov</media:title>
		</media:content>
	</item>
		<item>
		<title>Active Directory and CSV files</title>
		<link>http://dmitrysotnikov.wordpress.com/2009/08/27/active-directory-and-csv-files/</link>
		<comments>http://dmitrysotnikov.wordpress.com/2009/08/27/active-directory-and-csv-files/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 10:00:14 +0000</pubDate>
		<dc:creator>Dmitry Sotnikov</dc:creator>
				<category><![CDATA[AD]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[PowerGUI]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Webcast]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://dmitrysotnikov.wordpress.com/?p=1493</guid>
		<description><![CDATA[Here&#8217;s a new quick tip from Darin on AD exports and imports from within PowerGUI:

As usual, short and to the point.
Using CSV and text files in PowerGUI when managing AD is quite common. For example, I have seen people adding script node like:
Get-Content '\\server\share\users.txt' &#124; Get-QADUser
If users.txt has a bunch of usernames (one per line) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&blog=867377&post=1493&subd=dmitrysotnikov&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Here&#8217;s a new quick tip from Darin on AD exports and imports from within PowerGUI:</p>
<p><span style="text-align:center; display: block;"><a href="http://dmitrysotnikov.wordpress.com/2009/08/27/active-directory-and-csv-files/"><img src="http://img.youtube.com/vi/RrGByMvfdX8/2.jpg" alt="" /></a></span></p>
<p>As usual, short and to the point.</p>
<p>Using CSV and text files in PowerGUI when managing AD is quite common. For example, I have seen people adding script node like:</p>
<pre><span style="color:#5F9EA0;font-weight:bold;">Get-Content</span><span style="color:#000000;"> </span><span style="color:#800000;">'</span><span style="color:#800000;">\\server\share\users.txt</span><span style="color:#800000;">'</span><span style="color:#000000;"> | </span><span style="color:#5F9EA0;font-weight:bold;">Get-QADUser</span></pre>
<p>If <code>users.txt</code> has a bunch of usernames (one per line) this outputs actual user accounts to the PowerGUI grid, which you can then manage with all the actions (disable, reset passwords, and so on.)</p>
<p>Alternatively, some customers are just using
<pre><span style="color:#5F9EA0;font-weight:bold;">Import-Csv</span></pre>
<p> in a node and then define some actions to perform various activities based on the fields in the grid.</p>
<p>Also, although Darin did not show that, you can create your own export to CSV and use something like
<pre><span style="color:#5F9EA0;font-weight:bold;">Select</span><span style="color:#000000;"> Name, </span><span style="color:#800000;">samAccountName</span><span style="color:#000000;"> | </span><span style="color:#5F9EA0;font-weight:bold;">Export-Csv</span></pre>
<p> to pick specific columns to be exported.</p>
<p>And there&#8217;s whole update from CSV scenario&#8230; Man, I could go on and on with these! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span class="technoratitag">Tags: <a href="http://www.technorati.com/tag/AD" target="_blank" rel="tag" title="Link to Technorati Tag category for AD">AD</a>, <a href="http://www.technorati.com/tag/Active+Directory" target="_blank" rel="tag" title="Link to Technorati Tag category for Active Directory">Active Directory</a>, <a href="http://www.technorati.com/tag/Demo" target="_blank" rel="tag" title="Link to Technorati Tag category for Demo">Demo</a>, <a href="http://www.technorati.com/tag/PowerGUI" target="_blank" rel="tag" title="Link to Technorati Tag category for PowerGUI">PowerGUI</a>, <a href="http://www.technorati.com/tag/PowerShell" target="_blank" rel="tag" title="Link to Technorati Tag category for PowerShell">PowerShell</a>, <a href="http://www.technorati.com/tag/Webcast" target="_blank" rel="tag" title="Link to Technorati Tag category for Webcast">Webcast</a>, <a href="http://www.technorati.com/tag/video" target="_blank" rel="tag" title="Link to Technorati Tag category for video">video</a></span><br /><span class="sociallinks">Add to: | <a href="http://technorati.com/faves?add=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F08%2F27%2Factive%2Ddirectory%2Dand%2Dcsv%2Dfiles%2F" target="_blank">Technorati</a> |  <a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F08%2F27%2Factive%2Ddirectory%2Dand%2Dcsv%2Dfiles%2F" target="_blank">Digg</a> |  <a href="http://del.icio.us/post?url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F08%2F27%2Factive%2Ddirectory%2Dand%2Dcsv%2Dfiles%2F;title=Active%20Directory%20and%20CSV%20files" target="_blank">del.icio.us</a> |  <a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?t=Active%20Directory%20and%20CSV%20files&amp;u=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F08%2F27%2Factive%2Ddirectory%2Dand%2Dcsv%2Dfiles%2F" target="_blank">Yahoo</a> |  <a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F08%2F27%2Factive%2Ddirectory%2Dand%2Dcsv%2Dfiles%2F&amp;Title=Active%20Directory%20and%20CSV%20files" target="_blank">BlinkList</a> |  <a href="http://www.spurl.net/spurl.php?url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F08%2F27%2Factive%2Ddirectory%2Dand%2Dcsv%2Dfiles%2F&amp;title=Active%20Directory%20and%20CSV%20files" target="_blank">Spurl</a> |  <a href="http://reddit.com/submit?url=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F08%2F27%2Factive%2Ddirectory%2Dand%2Dcsv%2Dfiles%2F&amp;title=Active%20Directory%20and%20CSV%20files" target="_blank">reddit</a> |   <a href="http://www.furl.net/storeIt.jsp?t=Active%20Directory%20and%20CSV%20files&amp;u=http%3A%2F%2Fdmitrysotnikov%2Ewordpress%2Ecom%2F2009%2F08%2F27%2Factive%2Ddirectory%2Dand%2Dcsv%2Dfiles%2F" target="_blank">Furl</a> |  </span></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmitrysotnikov.wordpress.com/1493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmitrysotnikov.wordpress.com/1493/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmitrysotnikov.wordpress.com/1493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmitrysotnikov.wordpress.com/1493/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmitrysotnikov.wordpress.com/1493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmitrysotnikov.wordpress.com/1493/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmitrysotnikov.wordpress.com/1493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmitrysotnikov.wordpress.com/1493/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmitrysotnikov.wordpress.com/1493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmitrysotnikov.wordpress.com/1493/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&blog=867377&post=1493&subd=dmitrysotnikov&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dmitrysotnikov.wordpress.com/2009/08/27/active-directory-and-csv-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6ecc57e2c1be48013620bf85fb983dbf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmitrysotnikov</media:title>
		</media:content>

		<media:content url="http://img.youtube.com/vi/RrGByMvfdX8/2.jpg" medium="image" />
	</item>
	</channel>
</rss>