Monday, October 6, 2014

GPO Updates Remotely with PowerShell

Here is a quick script that will allow you to remotely force a GPO Update on a machine.  This will work on Windows 2008 Servers.

Side Note: Windows 2012 and Windows 8 can leverage the PowerShell cmdlet INVOKE-GPUPDATE


<#  Quick Powershell Script to Force Update GPO on remote systems.
       Script can be used on Windows 7 and Windows 2008 Systems
#>

#     Create CSV File of the Remote Systems that you need to change remotely
$Deploylist = "Location of your .CSV file"

#    Using the Invoke-Command, you can call the GPUPDATE /FORCE command directly on the remote system.

Import-CSV $Deploylist -UseCulture | %{
  Invoke-Command -ComputerName $_."Remote_System_Name" {
      gpupdate /force}
}

The CSV File should look something
Remote_System_Name
System01
System02
System03

-BostonTechGuy