PowerShell Logo Small

Save-NetGPO



This is the built-in help made by Microsoft for the command 'Save-NetGPO', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Applies the modified cached local Group Policy Object (GPO) to the actual GPO.

SYNTAX


Save-NetGPO [-GPOSession] <String> [-AsJob] [-CimSession <CimSession[]>] [-ThrottleLimit <Int32>] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Save-NetGPO cmdlet saves the changes made to the local cached group policy object. The cached Group Policy Object (GPO) copy is created with the Open-NetGPO cmdlet.


Individual operations on group policy objects require a round-trip to load the policy store. When the policy store is a GPO on a busy domain controller, an administrator
will want to open the GPO, do the work on it, and then save it back, with an in-memory copy.


Modifications are performed through the use of the GPOSession parameter.


Note: This cmdlet does not batch individual changes, it loads and saves the entire GPO at once. If any other changes were made by another administrator, or in a different
Windows PowerShell® session, saving the GPO would overwrite those changes.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkId=288209
New-NetFirewallRule
Open-NetGPO
Remove-NetFirewallRule

REMARKS

<

Examples


EXAMPLE 1

PS C:\>$gpoSession = Open-NetGPO –PolicyStore castle.contoso.com\Win8ClientFirewallPolicy



PS C:\>Remove-NetFirewallRule –Name BlockIMAccess –GPOSession $gpoSession



PS C:\>New-NetFirewallRule –Name LimitIMAccess –DisplayName "Contoso Messenger" –Program "%ProgramFiles(X86)%\Contoso Messenger\cmsg.exe" –Action Block –GPOSession
$gpoSession



PS C:\>Save-NetGPO –GPOSession $gpoSession



This example replaces one rule in a domain GPO with another using a cached copy of the GPO.