Has anyone Idea?
I'm working for hours on this but I'm not getting anywhere.
foreach($system in $systems){ $hyperv = invoke-command $system.DNSHostName -ScriptBlock {get-windowsfeature | Where {$_.name -match "Hyper-V"} | where {$_.installed -match $true}} }
$system.dnshostname gets every dnshostname of all the systems in the AD. But I don't know how to get only the ones with installed hyper-v features.
The way it is written I actually inly can information about the filtered features, like feature name...
I also still couldn't find a way to get from the VMs the name. get-vm delivers the VM name which isn't always the same as the DNS name.