API Reference
Command
Set-ADXLgpoPolicy
Sets an ADMX policy into Local GPO (Machine/User) using policy Id or DisplayName and optional element options.
Examples
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
- Policy name or display name from ADMX.
- State string
- Desired policy state.
- AdmxDirectory string
- Optional ADMX directory path.
- Backup SwitchParameter
- When set, creates a .bak copy of the target registry.pol before writing.
- Language string
- Optional ADMX language (e.g., en-US).
- Merge SwitchParameter
- When set, merges with existing registry.pol; otherwise overwrites only the policy entries.
- Options Hashtable
- Optional element values by name (hashtable) for enabled policies.
- Scope string
- Target policy scope.
- UserSid string
- Optional SID for per-user LGPO (when Scope=User).