This will return the number of computer objects in the OU, and ask if you’re sure.This will run a GPUpdate /force on all computer objects in the OU selected and any child OUs and will refresh both the computer and user policies. This method, requires Server 2012, or Windows 8 with the remote server administration tools.Every time I finish one, I write a couple of paragraphs on how long to wait, or how to force the policy etc.So I’ve finally got round to writing a post I can simply reference!The /Force and /Wait parameters will be ignored if specified.Enter the command you want to use below into the elevated command prompt, and press Enter.Examples include user-targeted Software Installation and Folder Redirection.This option has no effect if there are no extensions called that require a logoff.
(This avoids all user and computer policies being seen and applied at the same time.
So bear this in mind if you’re running this against your desktops or laptops with users logged in. The following Powershell will get you a list of computers from the Servers OU and export them to a text file on the C drive. I’ve added a dummy first entry to the text file, for some reason PSExec fails the first entry so this gets around that.
11/02/17 I’ve written hundreds of posts about doing things with group policies.
You must be signed in as an administrator to update Group Policy settings. Causes a logoff after the Group Policy settings are updated.
Sets the number of seconds to wait for policy processing to finish. This is required for those Group Policy client-side extensions that do not process policy on a background update cycle but do process policy when a user logs on.