<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Inventorying Computers with AD PowerShell</title><link>http://blogs.technet.com/b/askds/archive/2010/02/04/inventorying-computers-with-ad-powershell.aspx</link><description>Hi, Ned here again. Have you ever had to figure out what operating systems are running in your domain environment so that you can plan for upgrades, service pack updates, or support lifecycle transitions? Did you know that you don&amp;rsquo;t have to connect</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Inventorying Computers with AD PowerShell</title><link>http://blogs.technet.com/b/askds/archive/2010/02/04/inventorying-computers-with-ad-powershell.aspx#3311551</link><pubDate>Tue, 09 Feb 2010 14:42:39 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3311551</guid><dc:creator>NedPyle [MSFT]</dc:creator><description>&lt;p&gt;And yes, I did find an internal discussion on this, it's a known issue.&lt;/p&gt;
&lt;p&gt;I also found this, which is a much better solution than my first workaround:&lt;/p&gt;
&lt;p&gt;HOW TO CREATE A FUNCTION TO VALIDATE THE EXISTENCE OF AN AD OBJECT (Test-XADObject) &lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/adpowershell/archive/2009/05/05/how-to-create-a-function-to-validate-the-existence-of-an-ad-object-test-xadobject.aspx"&gt;http://blogs.msdn.com/adpowershell/archive/2009/05/05/how-to-create-a-function-to-validate-the-existence-of-an-ad-object-test-xadobject.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You could use this helper function to verify that an object exists before attempting to run further cmdlets against it.&lt;/p&gt;
&lt;p&gt;- Ned&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3311551" width="1" height="1"&gt;</description></item><item><title>re: Inventorying Computers with AD PowerShell</title><link>http://blogs.technet.com/b/askds/archive/2010/02/04/inventorying-computers-with-ad-powershell.aspx#3311548</link><pubDate>Tue, 09 Feb 2010 14:36:37 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3311548</guid><dc:creator>NedPyle [MSFT]</dc:creator><description>&lt;p&gt;Hmmm - I am able to reproduce that. Very irritating, I'll see if I can get an answer on that.&lt;/p&gt;
&lt;p&gt;As a rather lame workaround, I was able to set the global erroraction and it worked - you could do this in blocks around your 'might not find a computer and that's ok' code.&lt;/p&gt;
&lt;p&gt;$errorActionPreference = &amp;quot;SilentlyContinue&amp;quot;&lt;/p&gt;
&lt;p&gt;get-adcomputer fdfdfdsfsd&lt;/p&gt;
&lt;p&gt;$errorActionPreference = &amp;quot;stop&amp;quot;&lt;/p&gt;
&lt;p&gt;More info:&lt;/p&gt;
&lt;p&gt;get-help about_preference_variables&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3311548" width="1" height="1"&gt;</description></item><item><title>re: Inventorying Computers with AD PowerShell</title><link>http://blogs.technet.com/b/askds/archive/2010/02/04/inventorying-computers-with-ad-powershell.aspx#3311445</link><pubDate>Tue, 09 Feb 2010 08:32:01 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3311445</guid><dc:creator>rv-private</dc:creator><description>&lt;p&gt;I love the AD cmdlets, but one strange behavior I noticed is that error suppression via –erroraction doesn’t do the trick.&lt;/p&gt;
&lt;p&gt;e.g. when calling the get-adcomputer cmdlets in association with the name of a none-existing computername, I’d like to avoid an error being thrown, but no way ...&lt;/p&gt;
&lt;p&gt;Is this on purpose?&lt;/p&gt;
&lt;p&gt;C:\&amp;gt; get-adcomputer dummy -ea silentlycontinue&lt;/p&gt;
&lt;p&gt;Get-ADComputer : Cannot find an object with identity: 'dummy' under: 'DC=LABO,DC=LOCAL'.&lt;/p&gt;
&lt;p&gt;At line:1 char:15&lt;/p&gt;
&lt;p&gt;+ get-adcomputer &amp;lt;&amp;lt;&amp;lt;&amp;lt; &amp;nbsp;dummy -ea silentlycontinue&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;+ CategoryInfo &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: ObjectNotFound: (dummy:ADComputer) [Get-ADComputer], ADIdentityNotFoundException&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;+ FullyQualifiedErrorId : Cannot find an object with identity: 'dummy' under: 'DC=LABO,DC=LOCAL'.,Microsoft.ActiveDirectory.Management.Commands.GetADComputer&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3311445" width="1" height="1"&gt;</description></item><item><title>re: Inventorying Computers with AD PowerShell</title><link>http://blogs.technet.com/b/askds/archive/2010/02/04/inventorying-computers-with-ad-powershell.aspx#3310724</link><pubDate>Thu, 04 Feb 2010 20:53:58 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3310724</guid><dc:creator>Mike Kline</dc:creator><description>&lt;p&gt;Really good blog Ned. &amp;nbsp;I've still been going to my favorite tool(adfind) for stuff like this but powershell is definitely another great tool. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;For now the Quest cmdlets for where I am...Federal agency that is not yet at 2008 R2 (or even 2008).&lt;/p&gt;
&lt;p&gt;By the way is your &amp;quot;bird dog&amp;quot; nickname from the movie Bottle Rocket&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3310724" width="1" height="1"&gt;</description></item><item><title>re: Inventorying Computers with AD PowerShell</title><link>http://blogs.technet.com/b/askds/archive/2010/02/04/inventorying-computers-with-ad-powershell.aspx#3310710</link><pubDate>Thu, 04 Feb 2010 18:57:41 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3310710</guid><dc:creator>NedPyle [MSFT]</dc:creator><description>&lt;p&gt;And I updated the post with your point to insure it doesn't get lost in the unread comments. Thanks again.&lt;/p&gt;
&lt;p&gt;- Ned&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3310710" width="1" height="1"&gt;</description></item><item><title>re: Inventorying Computers with AD PowerShell</title><link>http://blogs.technet.com/b/askds/archive/2010/02/04/inventorying-computers-with-ad-powershell.aspx#3310708</link><pubDate>Thu, 04 Feb 2010 18:51:54 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3310708</guid><dc:creator>NedPyle [MSFT]</dc:creator><description>&lt;p&gt;Your first point is correct and I changed the wording.&lt;/p&gt;
&lt;p&gt;To your other main point though: as you can see, this post is designed around introduction to PowerShell for admins. The command-line is already long and cryptic enough to a novice - who is likely uncomfortable enough already - without perfectly forming the front of the pipeline. The amount of efficiency gained here is neglible compared to:&lt;/p&gt;
&lt;p&gt;1. The fact that this is showing a rare use inventory and not automation.&lt;/p&gt;
&lt;p&gt;2. Folks are getting their feet wet. They will learn filter left, format right.&lt;/p&gt;
&lt;p&gt;Thanks for the good feedback,&lt;/p&gt;
&lt;p&gt;- Ned &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3310708" width="1" height="1"&gt;</description></item><item><title>re: Inventorying Computers with AD PowerShell</title><link>http://blogs.technet.com/b/askds/archive/2010/02/04/inventorying-computers-with-ad-powershell.aspx#3310704</link><pubDate>Thu, 04 Feb 2010 18:38:56 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3310704</guid><dc:creator>dloder</dc:creator><description>&lt;p&gt;The statement &amp;quot;And I stopped asking for the OS version data&amp;quot; is not accurate. &amp;nbsp;The &amp;quot;-Property *&amp;quot; clause causes all properties to be returned. &amp;nbsp;All that happened is that you stopped displaying most of the data. &amp;nbsp;You still asked AD for the data. &amp;nbsp;AD still shipped it over the wire back to you. &amp;nbsp;Powershell just threw it away locally.&lt;/p&gt;
&lt;p&gt;The Filter Left, Format Right article from the September 2009 issue of Technet Magazine &lt;a rel="nofollow" target="_new" href="http://technet.microsoft.com/en-us/magazine/2009.09.windowspowershell.aspx"&gt;http://technet.microsoft.com/en-us/magazine/2009.09.windowspowershell.aspx&lt;/a&gt; does a decent job of trying to get people to trim the pipeline as early as possible. &amp;nbsp;The same concept holds for the list of property values. &amp;nbsp;You should be using (and informating others to use) both the Property and Filter parameters to trim the output up front and only ask for the data needed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3310704" width="1" height="1"&gt;</description></item></channel></rss>