<?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>Use PowerShell to Find Servers that Need a Reboot</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/20/use-powershell-to-find-servers-that-need-a-reboot.aspx</link><description>Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to find servers that need to be rebooted.</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Use PowerShell to Find Servers that Need a Reboot</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/20/use-powershell-to-find-servers-that-need-a-reboot.aspx#3571774</link><pubDate>Thu, 09 May 2013 19:53:56 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3571774</guid><dc:creator>TrevorHall</dc:creator><description>&lt;p&gt;Thanks Ed. Looking into this.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3571774" width="1" height="1"&gt;</description></item><item><title>re: Use PowerShell to Find Servers that Need a Reboot</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/20/use-powershell-to-find-servers-that-need-a-reboot.aspx#3571770</link><pubDate>Thu, 09 May 2013 19:46:26 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3571770</guid><dc:creator>Ed Wilson</dc:creator><description>&lt;p&gt;@TrevorHall No, that should not be it. You can remote from v2 to v3 and vice versa. take a look about remote troubleshooting topic &lt;a rel="nofollow" target="_new" href="http://go.microsoft.com/fwlink/?LinkID=135188"&gt;go.microsoft.com/fwlink&lt;/a&gt; to see if that will help. You might be running into a 32 bit / 64 bit thing ...&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3571770" width="1" height="1"&gt;</description></item><item><title>re: Use PowerShell to Find Servers that Need a Reboot</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/20/use-powershell-to-find-servers-that-need-a-reboot.aspx#3571761</link><pubDate>Thu, 09 May 2013 19:06:42 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3571761</guid><dc:creator>TrevorHall</dc:creator><description>&lt;p&gt;Powershell and WinRM are both 2.0 on the servers. 3.0 on my Win8 machine(running the cmdlet/script from). I have rights to access the registry keys on all servers.&lt;/p&gt;
&lt;p&gt;Powershell remoting - Yes to enabled on the servers. I didn&amp;#39;t have this turned on on my machine. Turned on, ran again, and it comes back with the same thing. Just the primary AD server. &amp;nbsp;Ah......crap. Could this be because this is a Win 2012 server running Powershell and WinRM 3.0 and the rest of our servers are 2008 with 2.0?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3571761" width="1" height="1"&gt;</description></item><item><title>re: Use PowerShell to Find Servers that Need a Reboot</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/20/use-powershell-to-find-servers-that-need-a-reboot.aspx#3571757</link><pubDate>Thu, 09 May 2013 18:40:47 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3571757</guid><dc:creator>Ed Wilson</dc:creator><description>&lt;p&gt;@TrevorHall Hmm, just a guess mind you, but do your other servers have WinRM and have you enabled PowerShell Remoting? What is the version of PowerShell, WinRM on those machines. What is the version of PowerShell / Windows you are using to remove from? Rights, Permissions to access the registry key? Unfortunately, there are dozens of potential things that can go wrong.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3571757" width="1" height="1"&gt;</description></item><item><title>re: Use PowerShell to Find Servers that Need a Reboot</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/20/use-powershell-to-find-servers-that-need-a-reboot.aspx#3571752</link><pubDate>Thu, 09 May 2013 18:20:13 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3571752</guid><dc:creator>TrevorHall</dc:creator><description>&lt;p&gt;This is killing me. This works...for the most part, but only returns our AD server as needing to be rebooted. I can login to several other servers and see the registry key, but those servers don&amp;#39;t show up. Why would this only be returning our AD server?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3571752" width="1" height="1"&gt;</description></item><item><title>re: Use PowerShell to Find Servers that Need a Reboot</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/20/use-powershell-to-find-servers-that-need-a-reboot.aspx#3553848</link><pubDate>Wed, 20 Feb 2013 16:13:15 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3553848</guid><dc:creator>IamMred</dc:creator><description>&lt;p&gt;@Brian Wilhite I am glad you like the article -- and thanks for sharing your way cool function via the Script Repository. &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3553848" width="1" height="1"&gt;</description></item><item><title>re: Use PowerShell to Find Servers that Need a Reboot</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/20/use-powershell-to-find-servers-that-need-a-reboot.aspx#3553847</link><pubDate>Wed, 20 Feb 2013 16:12:24 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3553847</guid><dc:creator>IamMred</dc:creator><description>&lt;p&gt;@Andreww you are right, using a corporate WSUS server or System Center is the best way to manage updates for a large (or even for a medium or small) network. I love your script. Thank you for sharing.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3553847" width="1" height="1"&gt;</description></item><item><title>re: Use PowerShell to Find Servers that Need a Reboot</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/20/use-powershell-to-find-servers-that-need-a-reboot.aspx#3553814</link><pubDate>Wed, 20 Feb 2013 14:11:29 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3553814</guid><dc:creator>Brian Wilhite</dc:creator><description>&lt;p&gt;Great article Ed! &amp;nbsp;This topic is near and dear to my heart... &amp;nbsp;Last year I was asked to determine pending reboot status on a lot of systems in our environment. &amp;nbsp;As you know, there are several keys that reference a reboot, so I compiled them in to a cool little PowerShell function called Get-PendingReboot, I have it uploaded on the script center:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://gallery.technet.microsoft.com/scriptcenter/Get-PendingReboot-Query-bdb79542"&gt;gallery.technet.microsoft.com/.../Get-PendingReboot-Query-bdb79542&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=3553814" width="1" height="1"&gt;</description></item><item><title>re: Use PowerShell to Find Servers that Need a Reboot</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/20/use-powershell-to-find-servers-that-need-a-reboot.aspx#3553779</link><pubDate>Wed, 20 Feb 2013 10:54:48 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3553779</guid><dc:creator>andreww</dc:creator><description>&lt;p&gt;If you use a corporate WSUS, you can find out which PCs are pending reboots from that. I wrote this script that will run on a schedule, in the middle of the night, and reboot any that are pending. It has various traps in it so if I run it during the day, interactively, it won&amp;#39;t do anything. You get the idea...&lt;/p&gt;
&lt;p&gt;# Script to find computers pending a WSUS reboot (coz someone is still logged-on to it... grrr)&lt;/p&gt;
&lt;p&gt;# and reboot them. OBVIOUSLY, do NOT run this during the day !!!!!&lt;/p&gt;
&lt;p&gt;$interactive = [Environment]::UserInteractive;&lt;/p&gt;
&lt;p&gt;# The above will detect if this is run interactively (as opposed to scheduled task)&lt;/p&gt;
&lt;p&gt;# if interactive, it will NOT reboot anything&lt;/p&gt;
&lt;p&gt;# if non-interactive, eg scheduled task, it will simply report&lt;/p&gt;
&lt;p&gt;[reflection.assembly]::LoadWithPartialName(&amp;quot;Microsoft.UpdateServices.Administration&amp;quot;) | out-null &lt;/p&gt;
&lt;p&gt;if (!$wsus) { &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer(); &lt;/p&gt;
&lt;p&gt;} &lt;/p&gt;
&lt;p&gt;$computerScope = new-object Microsoft.UpdateServices.Administration.ComputerTargetScope; &lt;/p&gt;
&lt;p&gt;$computerScope.IncludedInstallationStates = [Microsoft.UpdateServices.Administration.UpdateInstallationStates]::InstalledPendingReboot; &lt;/p&gt;
&lt;p&gt;$computers = $wsus.GetComputerTargets($computerScope); &lt;/p&gt;
&lt;p&gt;$theTime = Get-Date;&lt;/p&gt;
&lt;p&gt;$computers | foreach-object { &lt;/p&gt;
&lt;p&gt;	if ($interactive) {&lt;/p&gt;
&lt;p&gt;		write-host $_.FullDomainName;&lt;/p&gt;
&lt;p&gt;	} else {&lt;/p&gt;
&lt;p&gt;		# bit un-necessary... this can only run in the wee small hours if non-interactive (ie, schtask)&lt;/p&gt;
&lt;p&gt;		If($theTime.Hour -lt 7) {&lt;/p&gt;
&lt;p&gt;			Restart-Computer $_.FullDomainName -WhatIf; # remove the -Whatif when ready for production&lt;/p&gt;
&lt;p&gt;		}&lt;/p&gt;
&lt;p&gt;	}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3553779" width="1" height="1"&gt;</description></item></channel></rss>