Hello
I've created the below script unfortunately each time I run it it append the same VM that was previously configured with Network Adapter not started connected.
The idea is to get VMs with some details espacily the option if the VM has the NetAdapter is started connected or not and it's possible to add the NetworkAdapter type used?
I'm not sure what you actually want to do.
Perhaps a mockup of the desired output could help?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I'm trying to collect the below information for VMs
Isn't that what the original code in this thread is doing?
Or am I missing something?
PS: I notice 2 different accounts, are you the same person?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yep, I'm the same person and I think it's due to change that I made on my profile earlier, sorry about that😊
Regarding the script when I execute it not provide VMs that they have the network adapter set to false despite that I changed some VM to start without the network connected in order to be sure if I can get them in the csv or not
When I run the following I get all the VMs that do not have the StartConnected set to true.
Get-VM |
Get-NetworkAdapter | Where-object {-not $_.ConnectionState.StartConnected} |
Select-Object @{N = 'vCenter'; E = { ([uri]$_.Parent.ExtensionData.Client.ServiceUrl).Host }},
@{N="VM Name";E={$_.Parent}},
@{N="NIC Name";E={$_.Name}},
@{N="NIC Type";E={$_.Type}},
@{N="Network Name";E={$_.NetworkName}},
@{N="Connection State";E={$_.ConnectionState}},
@{N="MAC Address";E={$_.MacAddress}},
@{N="WakeOnLan Enabled";E={$_.WakeOnLanEnabled}} |
Sort-Object -Property 'VM Name' |
Export-Csv -Path .\NetAdapterStartUp.csv -NoTypeInformation -UseCulture
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Is that VM powered on?
Did you restart that VM after you changed the setting?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference