Hello
I'm glad to be able to answer this question for you, and I hope it helps.
If you are unable to log in to your Windows Server 2019 virtual machine due to the misconfigured Group Policy settings, there are several steps you can take to regain access:
1.Use Safe Mode: Restart the virtual machine and boot into Safe Mode. This will bypass some Group Policy settings and allow you to log in with administrative credentials. From there, you can modify or remove the problematic Group Policy settings.
2.Offline Group Policy Editing: Mount the virtual machine's hard disk on another Windows machine and edit the Group Policy settings offline. Follow these steps:
a. Create a backup of the virtual machine's VHD/VHDX file.
b. Attach the VHD/VHDX file to another Windows machine.
c. Open the Group Policy Object Editor (gpedit.msc) and load the virtual machine's registry hive (File -> Load Hive).
d. Navigate to the appropriate Registry key corresponding to the Group Policy settings you need to modify (HKLM\Software\Policies or HKLM\Software\Microsoft\Windows\CurrentVersion\Policies).
e. Make the necessary changes to disable or remove the Deny settings for the administrators group.
f. Unload the virtual machine's registry hive (File -> Unload Hive) and detach the VHD/VHDX file.
g. Reattach the modified VHD/VHDX file to the virtual machine and start it.
3.Reset Local Group Policy Settings: If the Group Policy settings are only applied at the local level and not from an Active Directory domain, you can reset the local Group Policy settings. To do this:
a. Boot the virtual machine from installation media (e.g., Windows Server 2019 ISO).
b. Select the language and keyboard layout preferences, then click "Next."
c. On the next screen, click "Repair your computer" in the bottom left corner.
d. Choose "Troubleshoot" -> "Advanced options" -> "Command Prompt."
e. In the Command Prompt, enter the following commands:
move C:\Windows\System32\GroupPolicy\Machine\Registry.pol C:\Windows\System32\GroupPolicy\Machine\Registry.pol.bak
move C:\Windows\System32\GroupPolicy\User\Registry.pol C:\Windows\System32\GroupPolicy\User\Registry.pol.bak
f. Restart the virtual machine and try to log in again.
Note: please back up your full OS or system status before you make any changes.
Hope the information above is helpful. If you have any question or concern, please feel free to let us know.
Best Regards,
Daisy Zhou
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.