Closed zerqent closed 3 years ago
Excellent suggestion. Thanks for sharing that! I'll get the code updated soon. :)
I'd suggest you use the same code as in New-AovpnConnection.ps1:
If ($CurrentPrincipal.Identities.IsSystem -ne $true) {
Write-Warning 'This script is not running in the SYSTEM context, as required. Exiting script.'
Exit
}
Good point! Looks like I'd already solved this issue and didn't know it. ;) I'll be updating this soon, I promise. :)
Ok, updated the script. Should work in all languages now. :)
Hello
When removing a device/allusers-connection with Remove-AoVPNConnection the script will check to see if the users name is "nt authorithy\system", however this will fail if the language of the system is not English.
I suggest checking for the SID instead (S-1-5-18) which should be available in $CurrentPrincipal.Identities.User.Vale in the code.
Cheers!