Do you have any idea how can I add a user in Local policies? I need same effect like this
gpedit.msc -> Computer Configuration / Windows Settings / Security Settings / Local Policies / User Rights Assignment / “Access this computer from the network”
I would like to do that by adding a registry key or by running a command from cmd. If you have any hint or internet resource to share, I would be happy.
Thanks.
Here’s one I prepared earlier. We use the (lengthy, sorry) wrapper class below to grant “Logon as a service right”. The call for this is as follows:
You would just need to replace “SeServiceLogonRight” with your own. A quick Google tells me this should be “SeNetworkLogonRight”. If you want this in a console app, then you can quickly compile one. Set your
Mainmethod like so:Then call as
YourConsoleApp.exe logon right. Here’s the wrapper: