8
0

add run as and use temp routes

This commit is contained in:
Benjamin Rechsteiner
2022-03-23 16:24:46 +01:00
parent 6409eb50b9
commit 6e373022df

View File

@@ -1,4 +1,4 @@
#requires -version 5 #requires -version 5
<# <#
.SYNOPSIS .SYNOPSIS
@@ -46,9 +46,10 @@ function Get-GwIp {
function Set-Route { function Set-Route {
$Gw = Get-GwIp $Gw = Get-GwIp
Foreach ($ip in $script:IPs) { Foreach ($ip in $script:IPs) {
$ip_route = "$ip/32" Start-Process -FilePath powershell.exe -ArgumentList {
New-NetRoute -DestinationPrefix $ip_route -NextHop $Gw.NextHop -InterfaceIndex $Gw.ifIndex | Out-Null route ADD $ip MASK 255.255.255.255 $Gw.NextHop
Write-Host "Set Route $ip_route through SSLVPN" } -verb RunAs
Write-Host "Set Route $ip/32 through SSLVPN"
} }
} }