Windows Command Line – Grant Dial-In Network Access Permission to Local Account

powershellremote-accessuser-managementvpnwindows

I am trying to configure a VPN server completely using Powershell. I have completed everything except the last step: Granting a local user account Dial-In / Network Access Permissions so that this user can access the VPN.

Via GUI it's easy to complete this step with the "Computer Management" app in the user properties / Dial In / Network Access Permission:

enter image description here

But how can I do this via Powershell? As an alternative, how can I grant the user permission to use the VPN by setting a NPS Network Policy via command line?

Best Answer

netsh seems to be able to do that.

netsh ras set user <username> permit