Windows PowerShell command on Get-command Save-NetGPO
MyWebUniversity

Windows PowerShell command on Get-command Save-NetGPO

NAME

Save-NetGPO

SYNOPSIS

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

SYNTAX

Save-NetGPO [-GPOSession] [-AsJob] [-CimSession ] [-ThrottleLimit ]

[]

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 PowerShellr session, saving the GPO would overwrite those changes.

PARAMETERS

-AsJob []

Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete. The cmdlet immediately returns an object that represents the job and then displays the command prompt. You

can continue to work in the session while the job completes. To manage the job, use the *-Job cmdlets. To get

the job results, use the Receive-Job cmdlet.

For more information about Windows PowerShellr background jobs, see about_Jobs. Required? false Position? named Default value Accept pipeline input? false Accept wildcard characters? false

-CimSession

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such

as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local

computer. Required? false Position? named Default value Accept pipeline input? false Accept wildcard characters? false

-GPOSession

Specifies the GPO session to be saved. This parameter is used in the same way as the PolicyStore parameter. When modifying GPOs in Windows PowerShellr, each change to a GPO requires the entire GPO to be loaded, modified, and saved back. On a busy

Domain Controller (DC), this can be a slow and resource-heavy operation. A GPO session loads a domain GPO onto

the local computer and makes all changes in a batch, before saving it back. This reduces the load on the DC

and speeds up the Windows PowerShell cmdlets. To load a GPO Session, use the Open-NetGPO cmdlet. To save a GPO

Session, use this cmdlet. Required? true Position? 1 Default value Accept pipeline input? false Accept wildcard characters? false

-ThrottleLimit

Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is entered, then Windows PowerShellr calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer. Required? false Position? named Default value Accept pipeline input? false Accept wildcard characters? false This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).

INPUTS

Microsoft.Management.Infrastructure.CimInstance#root\StandardCimv2\GPOSession The Microsoft.Management.Infrastructure.CimInstance object is a wrapper class that displays Windows Management Instrumentation (WMI) objects. The path after the pound sign (#) provides the namespace and class name for the underlying WMI object.

OUTPUTS

None

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.

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkId=288209

New-NetFirewallRule

Open-NetGPO

Remove-NetFirewallRule



Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 OurUNIX.com ™