7/22/2015

GPUPDATE REMOTELY

One of the speechs I sometimes hear from the level 2-3 support is: Just wait for the gpupdate half an hour or one hour. Well, that speech forced me and the GPO's :-) in the workstations to force inmediately the gpo from a single workstation or a group of workstations.

Let's use powershell to force this, and point to an specific OU. 

Requisites: do it from Windows 8 or Windows Server 2012 with the Remote Server Administration Tools installed:


This is for Windows 8. Make a quick search for Windows Server 2012

and make a call to the users that you are doing this because they'll get a black cmd window(~5-10 seconds) with the message that the GPO is updating.

Example: test domain, contoso.com and an OU named Accounting with a subOU named TEST:

PS C:\Users> get-adcomputer -SearchBase "OU=TEST,OU=ACCOUNTING,DC=CONTOSO,DC=COM" -Filter * | %{invoke-gpupdate -Computer $_.Name -RandomDelayInMinute 0; "Refreshing host $_."}


The output looks similar to this:

Refreshing host CN=PC1,OU=TEST,OU=ACCOUNTING,DC=CONTOSO,DC=COM
Refreshing host CN=PC2,OU=TEST,OU=ACCOUNTING,DC=CONTOSO,DC=COM
Refreshing host CN=PC3, OU=TEST,OU=ACCOUNTING,DC=CONTOSO,DC=COM 


Good Luck!

Note: you can do this also from the GUI Windows Server Administration Tools, but you are not always the admin.

No comments: