To enable the lock pages in memory from powershell

Below are the steps I have been doing from the Administrative Tools:

  1. On the Start menu, select Run. In the Open box, type gpedit.msc. The Group Policy dialog box opens.
  2. On the Local Group Group Policy console, expand Computer Configuration.
  3. Expand Windows Settings.
  4. Expand Security Settings.
  5. Expand Local Policies.
  6. Select the User Rights Assignment folder. The policies will be displayed in the details pane.
  7. In the pane, scroll to and double-click the Lock pages in memory policy.
  8. In the Local Security Policy Setting dialog box, select **Add User or Group…*. Add the Administrators.
  9. Select OK.
  10. Restart the instance for this setting to take effect.

Is there any options to perform the same with powershell script

Depending on where the setting is saved - for example a registry key - you could be able to manipulate the setting there.

The more professional way would be to use GPOs.