GPResult is a command line tool that shows the Resultant Set of Policy (RsoP) information for a user and computer. In other words, it creates a report that displays what group policies objects are applied to a user and computer. If your using group policy in your environment then you definitely should know how to. Gpupdate refreshes local and based on Active Directory, Group Policy settings, including security settings on the computer on which it is running. Gpupdate command can be used locally on a computer running Windows XP or later to immediately refresh rules. Option 2 – Rename gpupdate.exe. These steps will permanently prevent Group Policy updates from applying to a machine. Note: Be sure that Windows is set to show hidden and system files. From File Explorer, navigate to C: Windows System32. Right-click the “gpupdate.exe” file, then choose “Properties“. In a script, by using this command with a time limit specified, you can run gpupdate and continue with commands that do not depend upon the completion of gpupdate. Alternatively, you can use this command with no time limit specified to let gpupdate finish running before other commands that depend on it are run.
Ever needed to run a cmd on a remote computer such as gpupdate? this will show you how.
This of course assumes you have admin access to the remote PC
Open the Command Prompt windows. Make sure you run as admin and use credentials with admin rights on the remote machine
Use this command.
WMIC /node:'Computer Name' process call create “cmd.exe /c GPUpdate.exe /force” Money hack for samp 0.3 7.
Just Replace 'Computer Name' with the name of the remote computer. To be safe keep the ' around the computer name. without the quotes some characters seem to cause issues with this command
This example will run the command GPUpdate.exe /force If you wish to run something else. replace this with the command you wish to run.
That is it. your command will execute on the remote system. The only downside to this method is that you can't see the command execute or the results if there was a error.
But in a pinch this can be a very handy command
PSExec tends to be much faster. And if you have PowerShell remoting enabled, that is another option.
bobmccoy, that's true, but those are not always options. I recently had to do this (actually figured out how to do it with Invoke-WmiMethod, because I'm stubborn and wanted it to be a PowerShell solution), and in this environment, PSExec is disabled by security policy, and PS Remoting has never been enabled. I'm working on getting PS Remoting turned on, but having a backup to try for when those fail is always good.
And it has the benefit of not needing to add anything to a base windows install. It is just there and enabled
Batchpatch is also good for this kind of thing. If you need to do it on lots of computers.
You'll also need to have Windows firewall already allowing WMIC in. This is not set by default. Guide to deploy the GPO is here:
https://community.spiceworks.com/how_to/17452-group-policy-to-allow-wmi-access-to-remote-machine
if you need to run an application on multiple remote computers, I would recommend to use a third-party tool - Action1 can do this: https://www.action1.com/f/Free-Run-Application-with-Command-Line-atm-65.html
Mac Pro 8 Core 2.8 GHz, Mac OS X (10.5.5), 4GB RAM - 500GBx2 Software RAID 0
Posted on