Hello all! I’m fairly new to PowerShell and a co-worker of mine has been working on automating VPN setup. He created a few commands that work like a charm on every machine they are run on except mine. I did some research and based on the error I am getting I rebuilt my WMI index but that didn’t help. Really lost and would love any help you can give me! Code and errors are below. Thank you!
Troublesome code:
add-vpnconnection -Name TestVPN -ServerAddress 10.10.10.10 -Tunneltype “L2tp” -L2tpPsk ‘t3stk3y’ -AuthenticationMethod “PAP” -AllUserConnection -Force
Error I keep getting:
add-vpnconnection : Invalid class
At line:1 char:1
- add-vpnconnection -Name TestVPN -ServerAddress 10.10.10.10 -Tunneltyp …
-
+ CategoryInfo : MetadataError: (PS_VpnConnection:root/Microsoft/...S_VpnConnection) [Add-VpnConnection], CimException + FullyQualifiedErrorId : HRESULT 0x80041010,Add-VpnConnection