Hello all, I am in the process of writing a script to configure the VPN client on a handful (20+) client machines without having to get hands on with each machine. I have most of the logic I am just trying to figure out what else I need to get the pieces to fit together.
The first section I have basically sets up the script and all the variables used within the script
$REGPATH = "HKLM:\SYSTEM\CurrentControlSet\Services\PolicyAgent"
$REGNAME = "AssumeUDPEncapsulationContextOnSendRule"
$REGVALUE = "2"
$VPN_NAME = "VPN Friendly Name Here"
$VPN_SERVER = "123.123.123.123"
$VPN_TYPE = "L2tp"
$VPN_KEY = "supersecretkey"
$AUTHMETHOD = "MSChapv2"
So from there I can call the variables in my functions throughout the script for example
Function Set-RegKey {
New-ItemProperty -Path $REGPATH -Name $REGNAME -Value $REGVALUE -PropertyType DWORD -Force | Out-Null
}
Basically the logic I am trying to work through is this
Gather AD Users in VPN Allow group, Find their computer, Use PSRemoting to run registry edits and VPN client setup on their machine as the domain admin, Export results of each machine configured into a csv.
Is this possible and within the reach of Powershells capabilities, or should I stick with a GPO?
Any help is much appreciated and I can provide snippets upon request.