Skip to content

Instantly share code, notes, and snippets.

@nzbart
Created July 9, 2014 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nzbart/323a6f6586fb96a0356c to your computer and use it in GitHub Desktop.
Save nzbart/323a6f6586fb96a0356c to your computer and use it in GitHub Desktop.
Determine whether user has administrative privileges in PowerShell
(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