Quero conceder aos usuários não administradores o privilégio de iniciar/parar/verificar VMs específicas.
O cmdlet Grant-VMConnectAccess deve fazer o trabalho. Também adicionei o usuário ao grupo Usuários de gerenciamento remoto .
Mas ao tentar conectar-se à VM, recebo uma exceção .NET no log de eventos do Windows:
Application: vmconnect.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: Microsoft.Management.Infrastructure.CimException
at Microsoft.Management.Infrastructure.Internal.Operations.CimSyncEnumeratorBase`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
at System.Linq.Enumerable+WhereSelectEnumerableIterator`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
at Microsoft.Virtualization.Client.Management.Server.LoadOSInfo()
at Microsoft.Virtualization.Client.ConnectionHelper.ConnectServer(Microsoft.Virtualization.Client.InformationDisplayer, System.String, Boolean, Microsoft.Virtualization.Client.Common.IUserPassCredential)
at Microsoft.Virtualization.Client.ConnectionHelper.TryGetVirtualMachinesInternal(System.String, Microsoft.Virtualization.Client.Common.WindowsCredential, Mode, System.String, System.Guid, Microsoft.Virtualization.Client.Management.IVMComputerSystem ByRef, System.Collections.Generic.List`1<System.String> ByRef, System.Exception ByRef)
at Microsoft.Virtualization.Client.ConnectionHelper.TryGetVirtualMachine(System.String, Microsoft.Virtualization.Client.Common.WindowsCredential, System.String, Microsoft.Virtualization.Client.Management.IVMComputerSystem ByRef, System.Exception ByRef)
at Microsoft.Virtualization.Client.InteractiveSession.CommandLineParser.TryParse(System.String[], Microsoft.Virtualization.Client.InteractiveSession.RdpConnectionInfo ByRef)
at Microsoft.Virtualization.Client.InteractiveSession.VmisApplicationContext.TryParseCommandLine(System.String[])
at Microsoft.Virtualization.Client.InteractiveSession.Program.Main(System.String[])
vmconnect.exe só funcionou se eu também colocasse o usuário no grupo Administradores ou Administradores do Hyper-V . Mas isso dá ao usuário acesso total a todas as VMs.
Atualização : quero que funcione no Microsoft Hyper-V Server 10.0.17763 Build 17763. Mas também não consegui fazê-lo funcionar no Microsoft Windows Server 2019 Standard 10.0.17763 Build 17763