Need to use Group managed service account to fetch Hyper-V data

Viral Soni 0 Reputation points
2025-06-16T05:54:11.2533333+00:00

I have single machine (VM) running Windows server 2019 acting as both the Domain Controller (DC) and running Hyper-V service and want to fetch Hyper-V VMs data using Group managed service account. I have followed below steps but when I run 'Invoke-Command' to fetch the VM details, it is prompting for gMSA password though windows doesn't allow to set any password Group managed service account.

Add-KdsRootKey -EffectiveTime ((Get-Date).AddHours(-10))

New-ADServiceAccount -Name HyperVGMSA -DNSHostName HyperVGMSA.hyperv.local -PrincipalsAllowedToRetrieveManagedPassword "Win19-50-8-80$"

Install-ADServiceAccount HyperVgMSA

Test-ADServiceAccount HyperVgMSA

$service = Get-WmiObject Win32_Service -Filter "Name='vmms'"

Enable-PSRemoting -Force

Prompting for password while entering below command

Invoke-Command -ComputerName YourDC -Credential YOURDOMAIN\HyperVgMSA$ -ScriptBlock { Get-VM }

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
4,102 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.