Backup/Transfer Local Group Policy (User)


  1. Posts : 25
    Windows 10
       #1

    Backup/Transfer Local User Group Policy?


    OS: Windows 10 Pro (version 2004)

    I have been going crazy trying to figure out how to backup and transfer a user group-only policy without using a domain. I need to be able to setup a policy for non-administrators and use all the same setting configurations on dozens of computers that are not networked together or using a domain with a central policy, it has to be local-only.

    So I found a program by Microsoft called LGPO which backs up a local group policy and allows you to import it onto another computer but I have to verify it does not backup the SID, because some day these machines will be on the same network which is why I bare metal cloned a sysprepped base image before trying to apply this policy.

    The problem I am running into is that when I make changes to the "User Configuration" in the group policy editor it affects the users in the Administrators group as if I was applying them to "Computer Configuration" because there is no way for me to specify which user groups I want the policy applied to.

    I was going to try messing with Group Policy Management Console but its missing from Windows Administrative Tools in Windows 10 Pro. The other method I found was opening a console window (MMC) and adding snap-ins (Group Policy Object Editor). Then clicking browse under group policy object, selecting the users tab and select the group I want to apply the policy to. This generates a GPO (Local Computer\Non-Administrators Policy) that I can then make changes to the way I would in policy editor. This works, and if I run the command "gpupdate /boot" it applies this policy to only non-administrators. The thing is I can not export this object out of console, it only gives me an option to "export list" and if I run LGPO to back it up it does not work. I noticed after the policy is applied if I look in the group policy editor the settings are not reflected there under "User Configuration" which must be why LGPO is not backing up the non-administrators policy even after it has updated and is working correctly. I also tried to save the console and open it on another computer but the settings are not saved.

    So I need to either figure out how to get LGPO to backup the non-administrators policy or figure out how to make changes to user groups within group policy editor. Seems like this is a feature of the Group Policy Management Console but I was not able to add it to Windows 10 Pro with the add/remove features method.



    Please help!
    Last edited by pinkfloydeffect; 22 Sep 2020 at 17:55.
      My Computer


  2. Posts : 68,988
    64-bit Windows 11 Pro for Workstations
       #2

    Hello mate,

    You might check the method used in the tutorial below to backup group policy settings to see if it may help for what you want.

    Backup and Restore Local Group Policy Settings in Windows 10
      My Computers


  3. Posts : 25
    Windows 10
    Thread Starter
       #3

    Wow that looks incredibly simple! This explains why LGPO was only backing up the policy edited in GPEDIT because it was likely targeting %SystemRoot%\System32\GroupPolicy when the policy I had working with MMC was likely located in %SystemRoot%\System32\GroupPolicyUsers.

    I will give this a try when I get to work in the morning!
      My Computer


  4. Posts : 68,988
    64-bit Windows 11 Pro for Workstations
       #4

    I hope it will work for you.
      My Computers


  5. Posts : 25
    Windows 10
    Thread Starter
       #5

    This works exactly as needed, you just made my day!

    I owe you a beer man!
      My Computer


  6. Posts : 68,988
    64-bit Windows 11 Pro for Workstations
       #6

    Great news. You're most welcome.
      My Computers


  7. Posts : 25
    Windows 10
    Thread Starter
       #7

    I want to put this VBScript in my Windows base image along with my policy backup folder but I do not want them on the desktop. I put both the .vbs and the policy backup folder in "C:\ATECH" folder thinking it would pull from whatever root the script is located in but it did not work.

    Would you mind tweaking your script for me to pull the backup folder from "C:\ATECH" please?
      My Computer


  8. Posts : 68,988
    64-bit Windows 11 Pro for Workstations
       #8

    No problem. Here you go: :

    Backup_Local_Group_Policy.vbs

    Restore_Local_Group_Policy.vbs

    Code:
    If WScript.Arguments.length =0 Then
      		
    Set objShell = CreateObject("Shell.Application")
    objShell.ShellExecute "wscript.exe", Chr(34) & WScript.ScriptFullName & Chr(34) & " Run", , "runas", 1 
    
    Else 
    Set oShell = WScript.CreateObject ("WScript.Shell")
    
    oShell.run ("cmd.exe /c RD /S /Q %SystemRoot%\System32\GroupPolicy\Machine"),0
    
    oShell.run ("cmd.exe /c RD /S /Q %SystemRoot%\System32\GroupPolicy\User"),0
    
    oShell.run ("cmd.exe /c xcopy /c /e /h /i /q /y C:\ATECH\Local-Group-Policy-Backup\Machine %SystemRoot%\System32\GroupPolicy\Machine"),0
    
    oShell.run ("cmd.exe /c xcopy /c /e /h /i /q /y C:\ATECH\Local-Group-Policy-Backup\User %SystemRoot%\System32\GroupPolicy\User"),0
    
    oShell.run ("cmd.exe /c xcopy /c /e /h /i /q /y C:\ATECH\Local-Group-Policy-Backup\GroupPolicyUsers %SystemRoot%\System32\GroupPolicyUsers"),0
    
    WScript.Sleep 2000
    
    oShell.run "cmd.exe /k gpupdate /force"
    
    End If
      My Computers


  9. Posts : 25
    Windows 10
    Thread Starter
       #9

    You the man! I run a PowerShellCommander after the sysprepped and cloned base image boots up for the first time, which runs a list of commands to remove Windows bloatware apps that are installed after the sysprep. The last line I added was Start-Process -FilePath "C:\ATECH\Restore_Local_Group_Policy.vbs" which then kicks off your script. I love it!
      My Computer


  10. Posts : 68,988
    64-bit Windows 11 Pro for Workstations
       #10

      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 08:13.
Find Us




Windows 10 Forums