TestimoX

API Reference

Command

Import-ADXLgpo

Namespace ADPlayground.PowerShell

Imports Local GPO content from a GPMC backup, LGPO.exe text, or Policy Analyzer .PolicyRules.

Examples

Authored help example

Example 1: Import from GPMC backup (LGPO.exe /g parity)


Import-ADXLgpo -BackupPath C:\Backups\GPOs
        

Example 2: Import LGPO text (lgpo.exe text format), replacing existing entries


Import-ADXLgpo -LgpoTextPath .\baseline.lgpo.txt -Replace
        

Example 3: Convert PolicyRules to registry.pol and import to Machine scope


Import-ADXLgpo -PolicyRulesPath .\Baseline.PolicyRules -Scope Computer
        

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

Import-ADXLgpo -BackupPath <string> [-NoSecurityTemplate] [-Replace] [<CommonParameters>]
#
Parameter set: By BackupPath

Parameters

BackupPath string requiredposition: 0pipeline: false
Root folder of a GPMC backup to import.
NoSecurityTemplate SwitchParameter optionalposition: namedpipeline: false
When set, skips merging GptTmpl.inf security template.
Replace SwitchParameter optionalposition: namedpipeline: false
When set, overwrites existing registry.pol instead of merging.
Import-ADXLgpo -LgpoTextPath <string> [-ReplaceText] [<CommonParameters>]
#
Parameter set: By LgpoTextPath

Parameters

LgpoTextPath string requiredposition: 0pipeline: false
Path to an LGPO.exe 4‑line text file to import.
ReplaceText SwitchParameter optionalposition: namedpipeline: false
When set, overwrites existing registry.pol instead of merging.
Import-ADXLgpo -PolicyRulesPath <string> [-ReplaceRules] [-Scope <Computer|User>] [-UserSid <string>] [<CommonParameters>]
#
Parameter set: By PolicyRulesPath

Parameters

PolicyRulesPath string requiredposition: 0pipeline: false
Path to Microsoft Policy Analyzer .PolicyRules XML to convert and import.
ReplaceRules SwitchParameter optionalposition: namedpipeline: false
When set, overwrites existing registry.pol instead of merging.
Scope RegistryPolicyScope optionalposition: namedpipeline: falsevalues: 2
Target LGPO scope for PolicyRules import. Possible values: Computer, User
Possible values: Computer, User
UserSid string optionalposition: namedpipeline: false
Optional per-user SID when -Scope User (MLGPO).