Updating group policy immediately
I will be making extra blog postings about the trip, so stay tuned for details.If you are anywhere near where we will be, I encourage you to catch up with us.
Occasionally, they make changes at work, and I need to update my local Group Policy settings.The Scripting Guys community page has all the details.We will also be making postings on Facebook and Twitter.The thing is that they often want me to update Group Policy five times, and then wait five minutes between refreshes.No problem—I can do that in a single Windows Power Shell command line.This is shown here.$session = New-PSSession -cn $-cred $cred One thing to keep in mind is that at any given time in my domain, there are computers that are offline. Windows Power Shell keeps on creating new sessions in spite of the errors appearing in the console.
The command and associated errors are shown in the image that follows. Because the returned session objects reside in the $session variable, I can easily check to ensure the sessions are open. To run the GPUpdate command on all my remote machines, I use the Invoke-Command cmdlet.
To do this, I need to supply credentials to use for the remote session as well as use the New-PSSession cmdlet to create the connection.
The first part is easy, I use the Get-Credential cmdlet and store the returned credential object.
One of the recommendations I always give people who ask my opinion on updating to new versions of Windows is that if you do upgrade or deploy new servers to always do your Active Directory Domain Controllers first.
By updating the DCs first one can start implementing stronger authentication as clients are migrated and also start implementing policies that address the new versions of Windows as they start joining the domain.
To update Group Policy settings, I use the GPUpdateutility. By default, GPUpdate updates both computer and user portions of Group Policy.