Ying Li(MVP) at myITforum.com

PowerShell & System Center

PowerShell Script to refresh GPO remotely on multiple computers

Here is a KB article explains how to refresh the Group Policy Settings on remote computers. Basiclly you need to download PsTools from SysInternals and run something like this:

For Windows XP Computers:
Psexec.exe -@ComputerList.txt Gpupdate.exe /Target:User /force
Psexec.exe -@ComputerList.txt Gpupdate.exe /Target:Computer /force

Where you have the computer names in the ComputerList.txt file. I made a little effort to translate that into PowerShell

$colComputers = gc c:\users\yl.admin\pstools\ComputerList.txt

Foreach ($strComputer in $colComputers)

{.\psexec.exe \\$strComputer gpupdate.exe /target:computer /force}

You can change the target to user at you wish.

Posted: Aug 14 2008, 03:34 PM by yli628 | with 1 comment(s)
Filed under:

Comments

PowerShell Script to refresh GPO remotely on multiple computers said:

Pingback from  PowerShell Script to refresh GPO remotely on multiple computers

# August 14, 2008 8:16 PM