Keeping/ reinstating local group Policies for specific user after Sysprep

Anonymous
2024-08-01T22:23:06+00:00

Hello,

I am trying to sysprep a Windows 10 LTSC 2019 image while preserving local group policies I created for a specific user [REM]. I am not sure whether there is a way to preserve local group policies during sysprep with custom unattend options.
Otherwise, it would be great if there was a way to either backup/restore local group policies for specific users somehow, or if that isnt possible set local group policies for specific users with a powershell script.

I would greatly appreciate any help. I tried looking for similiar solutions for days but sadly this seems to be a very specific issue.

*** Move from Windows / Windows 10 / Settings ***

Windows for business | Windows Client for IT Pros | Directory services | Deploy group policy objects

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question. To protect privacy, user profiles for migrated questions are anonymized.

0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2024-08-02T07:02:47+00:00

    Hi Veronic Cassan,

    Thank you for posting in the Microsoft Community Forums.

    Use PowerShell scripts to back up and restore local group policies:

    Before Sysprep, you could have used a PowerShell script to back up the local Group Policy settings for a specific user. However, since local Group Policies are mainly stored in system-level folders (such as C:\Windows\System32\GroupPolicy), they are usually not directly associated with user accounts. However, you can back up the associated registry entries and files because some settings of Group Policy are reflected in the registry.

    You can try backing up the following folders and registry entries:

    C:\Windows\System32\GroupPolicy

    Relevant entries in the registry, such as HKEY_LOCAL_MACHINE\SOFTWARE\Policies

    Note that direct manipulation of the registry and system files requires caution and making sure you have a recovery plan.

    Recovering Group Policies:

    After your system has been deployed, you can use the same PowerShell script to restore previously backed up Group Policy settings. This usually involves copying the backed up files and registry entries back to their original locations and may require restarting the computer or running the gpupdate /force command to apply the changes.

    Use Group Policy Objects (GPOs) rather than local Group Policy:

    If you are working in a domain environment, it may be a better choice to use domain-based Group Policy Objects (GPOs) rather than local Group Policies. With a GPO, you can set policies for specific users or groups of users and apply those policies uniformly across multiple computers. In this way, you avoid the problem of needing to reconfigure local Group Policies at each deployment.

    Best regards

    Neuvi Jiang

    0 comments No comments
  2. Anonymous
    2024-08-02T09:18:52+00:00

    Hello Mr. Jiang,

    Thank you for your help!
    I have multiple backups before Sysprep, so I am asking in general.
    My issue is that I need the local Policies applied to that specific User for two reasons: #1 to keep the user from tempering with the device and #2 to allow an old printer to be redirected via RDP.

    Sadly I cannot use GPOs as I do not have access to the domain control, as such I would prefer to be able to use local group policies in this case.

    Thank you again for your help! I will try your method and reply once I have know if it worked.

    Best Regards,
    Veronic Cassan

    0 comments No comments