Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Run as System"-detection is failing in non-english versions of Windows #1

Open
kaivonderchrom opened this issue Sep 25, 2021 · 0 comments

Comments

@kaivonderchrom
Copy link

Hi,

thank you for your great work it helped me a lot! Only one thing I like to add, if your scripts checking, if it´s runing in SYSTEM context, it´s done via a string-compare to the username in line 153:

if($CurrentUserName -ne 'NT AUTHORITY\SYSTEM')

This is failing in, e.g. the german version, because it´s named "NT AUTORITÄT\SYSTEM". So I changed the check and used the well-known SIDs for it:

$CurrentSID = [System.Security.Principal.WindowsIdentity]::GetCurrent().User.Value
if($CurrentSID -ne 'S-1-5-18')

(SIDs can be found here: https://docs.microsoft.com/de-de/windows/security/identity-protection/access-control/security-identifiers)

Maybe it´s helpful in the New-AovpnDeviceTunnel.ps1 and Remove-AovpnDeviceTunnel.ps1.

Thank you!

Yours

Kai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant