Merge pull request #5076 from it-praktyk/Group_membership_by_SID

Verify membership in the group Hyper-V Administrators by SID not name
This commit is contained in:
Megan Marsh 2017-06-28 09:20:48 -07:00 committed by GitHub
commit c0e271ba9c
1 changed files with 3 additions and 1 deletions

View File

@ -297,7 +297,9 @@ func (d *HypervPS4Driver) verifyHypervPermissions() error {
log.Printf("Enter method: %s", "verifyHypervPermissions")
hypervAdminCmd := "([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole('Hyper-V Administrators')"
//SID:S-1-5-32-578 = 'BUILTIN\Hyper-V Administrators'
//https://support.microsoft.com/en-us/help/243330/well-known-security-identifiers-in-windows-operating-systems
hypervAdminCmd := "([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole('S-1-5-32-578')"
var ps powershell.PowerShellCmd
cmdOut, err := ps.Output(hypervAdminCmd)