That worked fine LucD thanks.
Googling I found another script that I have modified a little bit to get the vcenter name as well:
Get-VM |sort name| Get-NetworkAdapter | Where-object {$_.ConnectionState.StartConnected -ne "True"} |
foreach ($_) {Write-Host $_.Uid.Split('@')[1].Split(':')[0] $_.Parent.Name "("$_.Name") type:" $_.Type "Startconnected:" $_.ConnectionState.StartConnected} |
Export-Csv –append –path H:\Desktop\NetAdapterStartUp.csv -NoTypeInformation -UseCulture
I'm trying to export the output to a CSV file but seems to be not working, I just get an empty .csv