Hello,
I created a package to remove the Microsoft alwaysOn Usertunnel as user with this script :but can't uninstall the usertunnel
$scriptPath = "$env
rogramData\RemoveAOVPNUserTunnel.ps1"
$scriptContent = @'
$UserTunnelName = "UserTunnel"
$vpnInstance = Get-CimInstance -Namespace "root\cimv2\mdm\dmmap" -ClassName "MDM_VPNv2_01" |
Where-Object { $_.InstanceID -eq $UserTunnelName }
if ($vpnInstance) {
$vpnInstance | Remove-CimInstance
}
'@
$scriptContent | Set-Content -Path $scriptPath -Encoding UTF8
schtasks /Create /TN "RemoveAOVPNUserTunnel" /TR "powershell.exe -ExecutionPolicy Bypass -File `"$scriptPath`"" /SC ONCE /ST 00:00 /RL HIGHEST /RU "INTERACTIVE" /F
schtasks /Run /TN "RemoveAOVPNUserTunnel"
I created a package to remove the Microsoft alwaysOn Usertunnel as user with this script :but can't uninstall the usertunnel
$scriptPath = "$env
$scriptContent = @'
$UserTunnelName = "UserTunnel"
$vpnInstance = Get-CimInstance -Namespace "root\cimv2\mdm\dmmap" -ClassName "MDM_VPNv2_01" |
Where-Object { $_.InstanceID -eq $UserTunnelName }
if ($vpnInstance) {
$vpnInstance | Remove-CimInstance
}
'@
$scriptContent | Set-Content -Path $scriptPath -Encoding UTF8
schtasks /Create /TN "RemoveAOVPNUserTunnel" /TR "powershell.exe -ExecutionPolicy Bypass -File `"$scriptPath`"" /SC ONCE /ST 00:00 /RL HIGHEST /RU "INTERACTIVE" /F
schtasks /Run /TN "RemoveAOVPNUserTunnel"