Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

PENDING AlwaysOn UserTunnel To Remove

  • Thread starter Thread starter moulouy
  • Start date Start date
  • Replies Replies 2
  • Views Views 140

moulouy

Member
Messages
15
Reaction score
0
Points
1
Hello,
I created a package to remove the Microsoft alwaysOn Usertunnel as user with this script :but can't uninstall the usertunnel
$scriptPath = "$env:ProgramData\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"
 

Forum statistics

Threads
7,194
Messages
28,075
Members
18,345
Latest member
mrdany

Trending content

Back
Top