POWERSHELL CHALLENGE 001 : VMQ State on Hosts
Using :
- Windows Server 2012 R2
- MicroSoft System Center Virtual Machine Manager 2012 R2
Challenge:
Show the state of VMQ on every host in your Hyper-V environment
- Not intrested in the disabled state
- Hosts in multiple SCVMM environments
I would like that the output looks like this.
PSComputerName Name enabled ————– —- ——- Server001.usefullab.nl VM Team True … …
Extra challenge : One-Liner (Import-module line exluded)
Possible answer :
“VMMServer001”,”VMMServer002″| Foreach {Get-SCVMHostCluster -VMMServer $_ | Get-scvmhost | foreach {Get-NetAdapterVmq -CimSession $_.Name} | Select PSComputername,Name, enabled | Sort-Object PSComputername | Where {$_.Enabled -eq $true}}