Link to home
Start Free TrialLog in
Avatar of Faust Romero
Faust RomeroFlag for United States of America

asked on

gpupdate /force to all workstations

I need to do this via script either PowerShell to send gpupdate /force to all my workstation's OU only. I tried the below script without any luck. (see error). I need to send this with my credentials and hard force new computer group policy updates. Does anybody know how to send this out or what it is the easy way.

Get-ADComputer –filter * -Searchbase "OU=Workstations, DC=MYDOMAIN,dc=COM" | foreach{ Invoke-GPUpdate –computer $_.name -force}

User generated image
ASKER CERTIFIED SOLUTION
Avatar of Shaun Vermaak
Shaun Vermaak
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I've always used the GPUpdate tool in Active Directory users and computers: https://deployhappiness.com/remote-gpupdate-how-and-when-to-use-it/

Newer version of the Group Policy Management Console will also let you trigger a gpupdate remotely.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Faust Romero

ASKER

commands work fine after recommendation by LVL 83.