TestimoX

API Reference

Command

Set-ADXLgpoPolicy

Namespace ADPlayground.PowerShell

Sets an ADMX policy into Local GPO (Machine/User) using policy Id or DisplayName and optional element options.

Examples

Authored help example

Example 1: Enable a Machine policy by Name


Set-ADXLgpoPolicy -PolicyId "DisableCMD" -State Enabled -Scope Machine -Backup
        

Example 2: Disable a User policy by Display Name


Set-ADXLgpoPolicy -PolicyId "Prevent access to the command prompt" -State Disabled -Scope User
        

Example 3: Set with element options


Set-ADXLgpoPolicy -PolicyId "Internet Explorer\Disable AutoComplete" -State Enabled -Options @{ "StoreHistory" = $false }
        

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.

Syntax

Set-ADXLgpoPolicy -PolicyId <string> -State <string> [-AdmxDirectory <string>] [-Backup] [-Language <string>] [-Merge] [-Options <Hashtable>] [-Scope <string>] [-UserSid <string>] [<CommonParameters>]
#

Parameters

PolicyId string requiredposition: namedpipeline: false
Policy name or display name from ADMX.
State string requiredposition: namedpipeline: false
Desired policy state.
AdmxDirectory string optionalposition: namedpipeline: false
Optional ADMX directory path.
Backup SwitchParameter optionalposition: namedpipeline: false
When set, creates a .bak copy of the target registry.pol before writing.
Language string optionalposition: namedpipeline: false
Optional ADMX language (e.g., en-US).
Merge SwitchParameter optionalposition: namedpipeline: false
When set, merges with existing registry.pol; otherwise overwrites only the policy entries.
Options Hashtable optionalposition: namedpipeline: false
Optional element values by name (hashtable) for enabled policies.
Scope string optionalposition: namedpipeline: false
Target policy scope.
UserSid string optionalposition: namedpipeline: false
Optional SID for per-user LGPO (when Scope=User).