add run as and use temp routes
This commit is contained in:
@@ -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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user