<?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>How Can I Use Windows PowerShell to Get a List of All My Computers?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2006/11/09/how-can-i-use-windows-powershell-to-get-a-list-of-all-my-computers.aspx</link><description>Using Windows PowerShell, how can I retrieve a list of all the computer accounts in my domain? -- TE 
 Hey, TE. You know, several years ago the Scripting Guy who writes this column was playing basketball with one of his brothers. Because there were a</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: How Can I Use Windows PowerShell to Get a List of All My Computers?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2006/11/09/how-can-i-use-windows-powershell-to-get-a-list-of-all-my-computers.aspx#3501291</link><pubDate>Thu, 31 May 2012 16:44:43 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3501291</guid><dc:creator>Rishabh</dc:creator><description>&lt;p&gt;Is there a way to find computers that are currently logged in to your domain?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3501291" width="1" height="1"&gt;</description></item><item><title>re: How Can I Use Windows PowerShell to Get a List of All My Computers?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2006/11/09/how-can-i-use-windows-powershell-to-get-a-list-of-all-my-computers.aspx#3487894</link><pubDate>Wed, 21 Mar 2012 12:27:49 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3487894</guid><dc:creator>likewise</dc:creator><description>&lt;p&gt;Would you provide an example of getting computer list from another domain?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3487894" width="1" height="1"&gt;</description></item><item><title>re: How Can I Use Windows PowerShell to Get a List of All My Computers?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2006/11/09/how-can-i-use-windows-powershell-to-get-a-list-of-all-my-computers.aspx#3471495</link><pubDate>Fri, 16 Dec 2011 14:55:47 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3471495</guid><dc:creator>JV</dc:creator><description>&lt;p&gt;([adsisearcher]&amp;#39;(&amp;amp;(objectCategory=computer)(!operatingSystem=*server*))&amp;#39;).FindAll()&lt;/p&gt;
&lt;p&gt;You should post all quesrions here: &lt;a rel="nofollow" target="_new" href="http://social.technet.microsoft.com/Forums/en-US/ITCG"&gt;social.technet.microsoft.com/.../ITCG&lt;/a&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3471495" width="1" height="1"&gt;</description></item><item><title>re: How Can I Use Windows PowerShell to Get a List of All My Computers?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2006/11/09/how-can-i-use-windows-powershell-to-get-a-list-of-all-my-computers.aspx#3471421</link><pubDate>Fri, 16 Dec 2011 11:06:53 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3471421</guid><dc:creator>Rudi Thilo</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;Thanks a lot for that really cool one-liner!!&lt;/p&gt;
&lt;p&gt;To get this work more global, I&amp;#39;d like to distinguish WORKSTATIONs from SERVERs. Using google, I could find, that the computer.primarygroupid for DOMAINCONTROLLERS is 516, for all other computers (SERVER + WS) it&amp;#39;s 515.&lt;/p&gt;
&lt;p&gt;Any other trick to tell, if the COMPUTER is running a SERVER-OS, beside investigating &amp;quot;computer.operatingSystem&amp;quot; ?&lt;/p&gt;
&lt;p&gt;Thanks, Rudi.&lt;/p&gt;
&lt;p&gt;(for my syntax questions I&amp;#39;ll post separately)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3471421" width="1" height="1"&gt;</description></item><item><title>re: How Can I Use Windows PowerShell to Get a List of All My Computers?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2006/11/09/how-can-i-use-windows-powershell-to-get-a-list-of-all-my-computers.aspx#3471373</link><pubDate>Fri, 16 Dec 2011 04:21:22 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3471373</guid><dc:creator>JV</dc:creator><description>&lt;p&gt;@Rudi&lt;/p&gt;
&lt;p&gt;That is too easy -&amp;gt;&lt;/p&gt;
&lt;p&gt;([adsisearcher]&amp;#39;objectCategory=computer&amp;#39;).FindAll() |&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;?{$_.Properties[&amp;#39;name&amp;#39;] -notlike $env:computername} |&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;%{stop-computer $_.Properties[&amp;#39;name&amp;#39;] -whatif}&lt;/p&gt;
&lt;p&gt;One line - No muss! No fuss!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3471373" width="1" height="1"&gt;</description></item><item><title>re: How Can I Use Windows PowerShell to Get a List of All My Computers?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2006/11/09/how-can-i-use-windows-powershell-to-get-a-list-of-all-my-computers.aspx#3471352</link><pubDate>Thu, 15 Dec 2011 23:54:21 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3471352</guid><dc:creator>Rudi Thilo</dc:creator><description>&lt;p&gt;Howto use this to shutdown all *WORKSTATIONS* computers in the domain?&lt;/p&gt;
&lt;p&gt;This will give me all *computers* (including *SERVERS*) in the domain except that one, the script is running on (the PDC):&lt;/p&gt;
&lt;p&gt;foreach ($objResult in $colResults){$objComputer = $objResult.Properties; $objComputer.name|where {$objcomputer.name -ne $env:computername}}&lt;/p&gt;
&lt;p&gt;changing the final &amp;quot;}}&amp;quot; to something like &amp;quot;}|stop-computer -comp $objcomputer.name}&amp;quot; doesn&amp;#39;t work. :-(&lt;/p&gt;
&lt;p&gt;Regards, Rudi.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3471352" width="1" height="1"&gt;</description></item><item><title>re: How Can I Use Windows PowerShell to Get a List of All My Computers?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2006/11/09/how-can-i-use-windows-powershell-to-get-a-list-of-all-my-computers.aspx#3454797</link><pubDate>Wed, 21 Sep 2011 20:58:19 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3454797</guid><dc:creator>@COMMANDER</dc:creator><description>&lt;p&gt;It&amp;#39;s net view /domain :p&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3454797" width="1" height="1"&gt;</description></item><item><title>re: How Can I Use Windows PowerShell to Get a List of All My Computers?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2006/11/09/how-can-i-use-windows-powershell-to-get-a-list-of-all-my-computers.aspx#3449010</link><pubDate>Wed, 24 Aug 2011 20:52:32 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3449010</guid><dc:creator>COMMANDER</dc:creator><description>&lt;p&gt;You can just type in new view/ domain in CMD prompt. And it&amp;#39;ll list them LOL&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3449010" width="1" height="1"&gt;</description></item><item><title>re: How Can I Use Windows PowerShell to Get a List of All My Computers?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2006/11/09/how-can-i-use-windows-powershell-to-get-a-list-of-all-my-computers.aspx#3429642</link><pubDate>Tue, 17 May 2011 05:57:50 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3429642</guid><dc:creator>Phil</dc:creator><description>&lt;p&gt;It would be nice to sort the output by name.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3429642" width="1" height="1"&gt;</description></item><item><title>re: How Can I Use Windows PowerShell to Get a List of All My Computers?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2006/11/09/how-can-i-use-windows-powershell-to-get-a-list-of-all-my-computers.aspx#3383790</link><pubDate>Mon, 31 Jan 2011 17:46:26 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3383790</guid><dc:creator>Justin</dc:creator><description>&lt;p&gt;GD:&lt;/p&gt;
&lt;p&gt;you can do this get-member -i $objComputer&lt;/p&gt;
&lt;p&gt;this will display the members of that object. the thing to keep in mind is how it handles collections. you can do it two different ways, as i&amp;#39;ve shown above, which if run against a collection, will show the members of the collection class, if you run it like this&lt;/p&gt;
&lt;p&gt;$objComputer | get-member &lt;/p&gt;
&lt;p&gt;it will return the members of the object in the collection , basically the same as doing this&lt;/p&gt;
&lt;p&gt;get-member -i $objComputer[0]&lt;/p&gt;
&lt;p&gt;Confuddled:&lt;/p&gt;
&lt;p&gt;thats an easy one, use sort :)&lt;/p&gt;
&lt;p&gt;$objCollection | sort &amp;lt;property name&amp;gt;&lt;/p&gt;
&lt;p&gt;If you have questions stop by the technet forums&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://social.technet.microsoft.com/Forums/en/winserverpowershell/threads"&gt;social.technet.microsoft.com/.../threads&lt;/a&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3383790" width="1" height="1"&gt;</description></item></channel></rss>