Windows – PowerShell Command to Disable PPTP Remote Access Connections

powershellpptpvpnwindowswindows-server-2012-r2

I'm trying to automate the creation of a L2TP VPN server using PowerShell but I can't find any articles or cmdlets on how to disable PPTP inbound connections in RRAS using PowerShell. Below is a screenshot of the setting I'm trying to disable via PowerShell:

enter image description here

Additionally if there's a command to set the "Maximum Ports:" that would be useful as well.

Best Answer

Use netsh:

netsh ras set wanports device="WAN Miniport (PPTP)" rasinonly=disabled maxports=128