PowerShell

PowerShell: Force gpupdate on all Domain Computers

Client Computers update Group Policies every 90 minutes. In this blog post I force gupdate on all client computer of an organizational unit by running a PowerShell command from a remote computer.

Run the following command on a Domain Controller of the domain pagr.inet to force gpupdate on all client computer of the OU workstations:

Get-ADComputer -Filter * -SearchBase "OU=Workstations,DC=pagr,DC=com" | Foreach-Object {Invoke-GPUpdate -Computer $_.name -Force -RandomDelayInMinutes 0}

A quick glance at the client computer shows what happens: cmd pops up and gpupdate is running. Cool.

1.PNG

To force gpupdate on all domain computers just run

Get-ADComputer -Filter *  | Foreach-Object {Invoke-GPUpdate -Computer $_.name -Force -RandomDelayInMinutes 0}

Note: This command will force gpupdate on client computers and server systems.

Related Links

For restarting all domain computers see my post: Restart all Domain Computers by using PowerShell.

For documenting your environment see: PowerShell: Documenting your environment by running systeminfo on all Domain-Computers

4 replies »

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s