<?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>Force a Domain-Wide Update of Group Policy with PowerShell</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/11/12/force-a-domain-wide-update-of-group-policy-with-powershell.aspx</link><description>Microsoft Scripting Guy, Ed Wilson, shows how to force a domain-wide update of Group Policy by using Windows PowerShell.</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Force a Domain-Wide Update of Group Policy with PowerShell</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/11/12/force-a-domain-wide-update-of-group-policy-with-powershell.aspx#3558507</link><pubDate>Wed, 13 Mar 2013 21:18:34 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3558507</guid><dc:creator>jrv</dc:creator><description>&lt;p&gt;@bimplant&lt;/p&gt;
&lt;p&gt;$cn = get-content c:\servers.txt&lt;/p&gt;
&lt;p&gt;will not work on any version. &amp;nbsp;It is not possible to do this with a text file.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3558507" width="1" height="1"&gt;</description></item><item><title>re: Force a Domain-Wide Update of Group Policy with PowerShell</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/11/12/force-a-domain-wide-update-of-group-policy-with-powershell.aspx#3558486</link><pubDate>Wed, 13 Mar 2013 20:16:46 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3558486</guid><dc:creator>bimplant</dc:creator><description>&lt;p&gt;Hi. I&amp;#39;m getting the same error as SdeDot, but according to $host i&amp;#39;m on 3.0.&lt;/p&gt;
&lt;p&gt;Any Ideas? &lt;/p&gt;
&lt;p&gt;I&amp;#39;m using &lt;/p&gt;
&lt;p&gt;$cn = get-content c:\servers.txt&lt;/p&gt;
&lt;p&gt;$cred = ...&lt;/p&gt;
&lt;p&gt;$session = New-PSSession -cn $cn.name -cred $cred&lt;/p&gt;
&lt;p&gt;New-PSSession : Cannot validate argument on parameter &amp;#39;ComputerName&amp;#39;. The argument is null or empty. Supply an argument that is not null or empty and then try the command again.&lt;/p&gt;
&lt;p&gt;At line:1 char:30&lt;/p&gt;
&lt;p&gt;+ $session = New-PSSession -cn $cn.name -cred $cred&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3558486" width="1" height="1"&gt;</description></item><item><title>re: Force a Domain-Wide Update of Group Policy with PowerShell</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/11/12/force-a-domain-wide-update-of-group-policy-with-powershell.aspx#3533081</link><pubDate>Sat, 17 Nov 2012 10:24:15 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3533081</guid><dc:creator>Ed Wilson</dc:creator><description>&lt;p&gt;@SEDDot yes, using $cn.name is a PowerShell 3.0 syntax.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3533081" width="1" height="1"&gt;</description></item><item><title>re: Force a Domain-Wide Update of Group Policy with PowerShell</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/11/12/force-a-domain-wide-update-of-group-policy-with-powershell.aspx#3532187</link><pubDate>Tue, 13 Nov 2012 11:01:46 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3532187</guid><dc:creator>SdeDot</dc:creator><description>&lt;p&gt;I believe my issue is due to running the script on a 2.0 system and $cn.name can only be done on a 3.0 system.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3532187" width="1" height="1"&gt;</description></item><item><title>re: Force a Domain-Wide Update of Group Policy with PowerShell</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/11/12/force-a-domain-wide-update-of-group-policy-with-powershell.aspx#3532178</link><pubDate>Tue, 13 Nov 2012 10:18:19 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3532178</guid><dc:creator>SdeDot</dc:creator><description>&lt;p&gt;So what am I missing here?&lt;/p&gt;
&lt;p&gt;When I run the following:&lt;/p&gt;
&lt;p&gt;$cn = Get-ADDomainController -filt *&lt;/p&gt;
&lt;p&gt;$cred = Get-Credential acme\Batman&lt;/p&gt;
&lt;p&gt;$session = New-PSSession -cn $cn.name -cred $cred&lt;/p&gt;
&lt;p&gt;I get the following error:&lt;/p&gt;
&lt;p&gt;New-PSSession : Cannot validate argument on parameter &amp;#39;ComputerName&amp;#39;. The argument is null or empty. Supply an argumen&lt;/p&gt;
&lt;p&gt;t that is not null or empty and then try the command again.&lt;/p&gt;
&lt;p&gt;At line:3 char:29&lt;/p&gt;
&lt;p&gt;+ $session = New-PSSession -cn &amp;lt;&amp;lt;&amp;lt;&amp;lt; &amp;nbsp;$cn.name -cred $cred&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;+ CategoryInfo &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: InvalidData: (:) [New-PSSession], ParameterBindingValidationException&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;+ FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.NewPSSessionCommand&lt;/p&gt;
&lt;p&gt;When I list $cn, it contains all my DCs. &amp;nbsp;When I list $cn.name, I do not see anything.&lt;/p&gt;
&lt;p&gt;What I did to get this to work is the following:&lt;/p&gt;
&lt;p&gt;$cn = Get-ADDomainController -filt * | sort name | select -Expandproperty name&lt;/p&gt;
&lt;p&gt;$session = New-PSSession -cn $CN &lt;/p&gt;
&lt;p&gt;icm -Session $session -ScriptBlock {gpupdate /force}&lt;/p&gt;
&lt;p&gt;icm -Session $session -ScriptBlock {Get-EventLog -LogName system -InstanceId 1502 -Newest 1}&lt;/p&gt;
&lt;p&gt;remove-pssession $Session&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3532178" width="1" height="1"&gt;</description></item><item><title>re: Force a Domain-Wide Update of Group Policy with PowerShell</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/11/12/force-a-domain-wide-update-of-group-policy-with-powershell.aspx#3532174</link><pubDate>Tue, 13 Nov 2012 10:08:28 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3532174</guid><dc:creator>SdeDot</dc:creator><description>&lt;p&gt;Good practical use of Powershell I can use on a regular basis. &amp;nbsp;Thanks&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3532174" width="1" height="1"&gt;</description></item><item><title>re: Force a Domain-Wide Update of Group Policy with PowerShell</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/11/12/force-a-domain-wide-update-of-group-policy-with-powershell.aspx#3532032</link><pubDate>Mon, 12 Nov 2012 20:41:29 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3532032</guid><dc:creator>IamMred</dc:creator><description>&lt;p&gt;@PowerShell100 Yes you are correct. The remote servers all have WinRM enabled. Some of the Domain Controllers are Windows Server 2012, Some are Windows Server 2008 R2, and one is Windows Server 2008. The Windows Server 2008 Domain Controller has the Active Directory GateWay service running on it.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3532032" width="1" height="1"&gt;</description></item><item><title>re: Force a Domain-Wide Update of Group Policy with PowerShell</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/11/12/force-a-domain-wide-update-of-group-policy-with-powershell.aspx#3531981</link><pubDate>Mon, 12 Nov 2012 17:11:22 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3531981</guid><dc:creator>Powershell100</dc:creator><description>&lt;p&gt;I presume you must have the winrm service running on the server/workstations, and the&lt;/p&gt;
&lt;p&gt;Domain controllers are on server 2008 r2, or gateway service installed in 2008?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3531981" width="1" height="1"&gt;</description></item><item><title>re: Force a Domain-Wide Update of Group Policy with PowerShell</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/11/12/force-a-domain-wide-update-of-group-policy-with-powershell.aspx#3531926</link><pubDate>Mon, 12 Nov 2012 13:21:04 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3531926</guid><dc:creator>Ed Wilson</dc:creator><description>&lt;p&gt;@Incredulous -- nope. not kidding. Been told that on several occasions. Luckily, PowerShell makes it easy to comply.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3531926" width="1" height="1"&gt;</description></item><item><title>re: Force a Domain-Wide Update of Group Policy with PowerShell</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/11/12/force-a-domain-wide-update-of-group-policy-with-powershell.aspx#3531863</link><pubDate>Mon, 12 Nov 2012 08:21:39 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3531863</guid><dc:creator>Incredulous</dc:creator><description>&lt;p&gt;Refresh group policy five times, five minutes apart? Are you kidding?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3531863" width="1" height="1"&gt;</description></item></channel></rss>