1

I have account within Administators group

The code Powershell ( and .NET as well )

(new-object System.Security.Principal.WindowsPrincipal([System.Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole("Administrators")

returns false


I ran command

[System.Security.Principal.WindowsIdentity]::GetCurrent().Groups

in 2 cases under my account and Powershell as Administrative

and found that Powershell as Administrative has 4 more roles

Powershell as Administrative

    BinaryLength AccountDomainSid              Value
    -- ----------------                        -----
    12                                         S-1-1-0
    12                                         S-1-5-114      - Extra
    28 S-1-5-21-573147726-3479669810-588349159 S-1-5-21-573147726-3479669810-588349159-1001
    16                                         S-1-5-32-544   - Extra
    16                                         S-1-5-32-551   - Extra
    16                                         S-1-5-32-559
    16                                         S-1-5-32-547   - Extra
    16                                         S-1-5-32-545
    12                                         S-1-5-4
    12                                         S-1-2-1
    12                                         S-1-5-11
    12                                         S-1-5-15
    52                                         S-1-11-96-3623454863-58364-18864-2661722203-1597581903-24264218...
    12                                         S-1-5-113
    12                                         S-1-2-0
    16                                         S-1-5-64-36


Powershell as Me
    BinaryLength AccountDomainSid              Value
    -- --------------------------              -----
    12                                         S-1-1-0
    28 S-1-5-21-573147726-3479669810-588349159 S-1-5-21-573147726-3479669810-588349159-1001
    16                                         S-1-5-32-559
    16                                         S-1-5-32-545
    12                                         S-1-5-4
    12                                         S-1-2-1
    12                                         S-1-5-11
    12                                         S-1-5-15
    52                                         S-1-11-96-3623454863-58364-18864-2661722203-1597581903-24264218...
    12                                         S-1-5-113
    12                                         S-1-2-0
    16                                         S-1-5-64-36

Question : How can I set my account as truly admin?

ekad
  • 14,436
  • 26
  • 44
  • 46
  • Possible duplicate of [PowerShell: Running a command as Administrator](https://stackoverflow.com/questions/7690994/powershell-running-a-command-as-administrator) – BenH May 27 '17 at 19:46
  • 2
    There's nothing wrong with the account, by default all applications are run without administrator privilege due to UAC. Right-click on Powershell and select the "Run as administrator" option to run Powershell with elevated privileges. – Harry Johnston May 27 '17 at 23:11

0 Answers0