From 7bacc22825d280de4ef698dd957d00b0bd5094f0 Mon Sep 17 00:00:00 2001 From: Wojciech Sciesinski Date: Wed, 28 Jun 2017 01:44:04 +0200 Subject: [PATCH] Verify membership in the group Hyper-V Administrators by SID not name - fix #5022 --- builder/hyperv/common/driver_ps_4.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/builder/hyperv/common/driver_ps_4.go b/builder/hyperv/common/driver_ps_4.go index c954a3d46..b608c2afd 100644 --- a/builder/hyperv/common/driver_ps_4.go +++ b/builder/hyperv/common/driver_ps_4.go @@ -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)