Created
July 9, 2014 01:59
-
-
Save nzbart/323a6f6586fb96a0356c to your computer and use it in GitHub Desktop.
Determine whether user has administrative privileges in PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(New-Object Security.Principal.WindowsPrincipal ([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment