richardhicks / aovpn

PowerShell scripts and sample ProfileXML files for configuring Windows 10 Always On VPN
MIT License
158 stars 83 forks source link

Change check for system user #3

Closed AmigaTeenageRiot closed 4 years ago

AmigaTeenageRiot commented 4 years ago

The check for NT AUTHORITY\SYSTEM only works in English versions of Windows (it's a localized string, so it's different on every localized version of Windows). I've changed it to check for the IsSystem property, which is a Boolean (see: https://docs.microsoft.com/en-us/dotnet/api/system.security.principal.windowsidentity.issystem?view=netframework-4.8#System_Security_Principal_WindowsIdentity_IsSystem)

AmigaTeenageRiot commented 4 years ago

Your work helped me a ton implementing AoV, so I'm glad to be able to give back just a little 😃