Hello there,
If you are talking about network adapters that are "not connected", you can use something like:
Get-VM | ?{$_.PowerState -eq "PoweredOn"} | %{
$strVMName = $_.Name; Get-NetworkAdapter -VM $_ | `
select @{n="VMName"; e={$strVMName}},Name,NetworkName,ConnectionState
} | ?{$_.ConnectionState.Connected -eq $false}
That gets all powered on VMs, gets their network adapters, and returns info about ones whose ConnectionState.Connected property is $false.
Hope this resolves your Query !!
--If the reply is helpful, please Upvote and Accept it as an answer--
Vm list in AzureUpdateManagement for "Not assessed" VM through Powershell
Azuretech
90
Reputation points
We are using automation to patch multiple VMS using azureUpdateManagement (powershell based scripts) . I want to know how to get the VM name which are disconnected and showing" Not assessed" in UpdateManagement though Powershell,even though it's added in updateManagement. I want to use this VM name list in order to remove it from the patch schedule as it gives error if any of the VM is "not connected/not assessed" in a deploymnet schedule.
1 answer
Sort by: Most helpful
-
Limitless Technology 44,326 Reputation points
2023-04-20T15:29:47.52+00:00