To assign a service account to the Lock Pages in Memory policy in Local Security Policy, you can use the following steps:
Open Local Security Policy by typing "secpol.msc" in the Run dialog box or the Start menu search box and then press Enter.
Expand the Local Policies node and then click on the User Rights Assignment node.
Double-click the "Lock pages in memory" policy to open its properties.
Click the Add User or Group button to add the service account you want to assign this policy to.
Enter the name of the service account, and then click the Check Names button to verify the account name.
Click OK to close the dialog box and save the changes.
Close Local Security Policy.
If you prefer to use a script to do this, you can modify the script from the thread you mentioned in your question as follows:
Replace the string "SeInteractiveLogonRight" with "SeLockMemoryPrivilege" in the script.
Replace the string "GrantLogOnLocally" with "LockMemory" in the script.
Modify the secedit command to include the "/areas USER_RIGHTS SECURITYPOLICY" option as follows:
Copy secedit /export /cfg $cfgFile /areas USER_RIGHTS SECURITYPOLICY
- Replace the string "GrantLogOnLocally" with "LockMemory" in the script.
After making these changes, you should be able to run the script to assign the Lock Pages in Memory policy to the service account.