How to make a file to update and configure local group polices and local security polices in windows 10?

Hussain I. Al-Mousa 21 Reputation points
2022-12-07T07:12:17.883+00:00

Dear All,

I am an IT Support in the education environment.

I need some shortcuts to make the installation of the devices go faster.
There is a way to make a batch file or batch script to make changes in Regedit.

The thing I need is to make a batch file or batch script to make changes in the Local group policy and Local security policy.
for example:

  • Disable Last User Name
  • Disable the Lock Option
  • Disable the Shutdown Option
  • Disable Switch User

And more.

Could you please help me with this issue?

Regards,
Hussain

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

Accepted answer
  1. Limitless Technology 44,766 Reputation points
    2022-12-08T10:29:40.92+00:00

    Hello there,

    LGPO.exe is a new command-line utility to automate the management of local group policy.

    https://learn.microsoft.com/en-us/archive/blogs/secguide/lgpo-exe-local-group-policy-object-utility-v1-0

    All the group policy editor does is set registry keys. If you can identify what keys are being set for the policy you want, you can use reg.exe to set those keys.

    reg.exe add HKCU\Software\path\to\regkey\ /v valuename /d newvalue

    If you do this in a batch, you will have to run the batch as administrator to touch the C:\windows\system32 folder.

    Similar discussion here
    https://learn.microsoft.com/en-us/answers/questions/940542/how-can-create-a-batch-file-to-local-group-policy.html

    ----------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept it as an answer--

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.