LogoLogo
OSDeploy.comTwitterGitHub
  • Overview
  • OSDeploy Home
  • Download
    • Release Notes
    • GitHub
    • LGPO
    • OSDeploy PowerShell Module
  • Docs
    • Deployment
      • ConfigMgr New PC TS Package
      • ConfigMgr New PC TS Unattend.xml
      • ConfigMgr New PC TS Provisioning Package
      • MDT New PC TS
    • Customize
      • Alpha
      • Apps
      • Background
      • LocalPolicy
        • ImportGPO
        • ImportTXT
        • LGPO
        • Import-GPO.ps1
      • RegistryXML
      • Scripts
      • Start
      • Theme
      • Zeta
    • Group Policies
      • Best Practices
        • Edit Local Policy with Reg Keys
      • Active Directory GPO
      • Build a Domain Controller
      • Update ADMX Templates
      • Local vs Domain Policies
      • Import OSDeploy GPOs
      • Edit OSDeploy Branding GPO
    • Provisioning Packages
      • PowerShell Script to PPKG
      • OSConfig to PPKG
    • Registry
      • Group Policy Preferences
      • GPP Registry.xml
      • RegistryXML Files
      • Convert REG to RegistryXML
      • Apply RegistryXML Files
    • How To
      • Theme Customization
Powered by GitBook
On this page

Was this helpful?

  1. Docs
  2. Customize
  3. LocalPolicy

Import-GPO.ps1

PreviousLGPONextRegistryXML

Last updated 5 years ago

Was this helpful?

This script is the key to importing Group Policy. The script imports all GPO's in the ImportGPO directory. Pay attention to the naming standards. If you need a GPO in this directory applied to Windows 10 and not any other Operating System, make sure Win10 is in the name of the GPO. The same pattern applies to Win7 and Windows Server (Windows Server filtering was added to this script in version 18.9.2)

Import Registry Preferences

The same filtering is used in finding GPO Registry.xml files (Windows Server filtering was added to this script in version 18.9.2).

The next step is to mount the Default User and Administrator Registry Hives

And then to go through all the XML nodes

And write the Registry Values into the Registry (hives will be dismounted when complete)

During execution of the script, the console output will look like this

​