question

AaronEOM-7213 avatar image
0 Votes"
AaronEOM-7213 asked YoungYang-MSFT answered

Powershell script windows xp , 7 , 10

Hi !

i made powershell script for create vpn profile on Windows 10 , but this script doesn't work on windows xp , embedded standard and 7 .

our pos system still using windows those windows version. and we need using L2TP client vpn of Cisco Meraki ,

can anyone makes me powershell script for each windows version ?

this is powershell script on windows 10 that is working very well.

$ServerAddress = "123.123.123.123"
$ConnectionName = "VPNTEST"
$PresharedKey = "vpntest"
$Destination = "192.168.33.0/24"
$Destination2 = "192.168.100.0/24"
Add-VpnConnection -Name "$ConnectionName" -ServerAddress "$ServerAddress" -TunnelType L2tp -L2tpPsk "$PresharedKey" -AuthenticationMethod Pap
Set-VpnConnection -Name $ConnectionName -SplitTunneling $True
Add-Vpnconnectionroute -Connectionname $ConnectionName -DestinationPrefix $Destination
Add-Vpnconnectionroute -Connectionname $ConnectionName -DestinationPrefix $Destination2

windows-server-powershell
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

It's going to be hard to help you if you don't tell us what error you are getting. Can you configure the VPN using the client that is installed with the software?

0 Votes 0 ·

no i don't using any software. i just want to create vpn profile by windows powershell script. as i wrote, when i run this powershell script on windows 10 , it could doing well, but windows 7 or windows xp are not working with this error message as i attached. thanks.![17141-image6217e2ebb47843ea492585c00029d6062020081016365.png][1] [1]: /answers/storage/temp/17141-image6217e2ebb47843ea492585c00029d6062020081016365.png

0 Votes 0 ·
Soccan avatar image
1 Vote"
Soccan answered Soccan edited

The cmdlets you are trying to use is only available in certain windows versions, those being Server 2012, 2012R2, 2016 and Windows 10. According to: https://docs.microsoft.com/en-us/powershell/module/vpnclient/add-vpnconnection?view=win10-ps

To get something working with WinXP will most likely be very tricky, while I would think Google or Bing would be your friend to find something DotNet that you can apply to Windows 7.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

YoungYang-MSFT avatar image
0 Votes"
YoungYang-MSFT answered

Hi, given that this post has been quiet for a while, this is a quick question and answer. Has your question been solved? If so, please mark it as an answer so that users with the same question can find and get help.
:)

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.