Skip to content

Conversation

@juangranados
Copy link

Test-AdminRights did not work on non english systems.
Source: Hey Scripting Guy blog.
http://blogs.technet.com/b/heyscriptingguy/archive/2011/05/11/check-for-admin-credentials-in-a-powershell-script.aspx
Now it works on all Windows Versions.

@juangranados
Copy link
Author

Hi Clint! Thank you for your amazing tool. I was installing it on a Windows Server with spanish languaje and Test-AdminRights always returned false because $oOutput variable contains spanish messages. I changed it by Scripting Guy function that works in all languages.

@clinthuffman
Copy link
Owner

clinthuffman commented Aug 20, 2019 via email

@ludovicferra
Copy link

Hi @clinthuffman for elevated detection this work for all systems langages :
function Test-AdminRights { ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator') }

Thanks

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

Successfully merging this pull request may close these issues.

3 participants