Solved

Modifying Powershell to list VM with certain hardware installed

Posted on 2010-11-16
6
809 Views
Last Modified: 2012-05-10
Hi,

I'd like to know if it is possible to modify this script to include the adapter type in the next column ?

Thanks,

JJ

Note: this is the continuation from http://www.experts-exchange.com/Programming/Languages/Scripting/Powershell/Q_26591906.html
###########################################################################################
# TScript: List VMs with Network Adapter Type											  #
# Created by: Luciano Patrão													       	  #
# Date: 04-10-2010   						 	     	                	       		  #
###########################################################################################

Connect-VIServer $server -User $user -Password $pwd

$vms = Get-VM
write "`nVM's with Network Adapter Type: "
foreach ($vm in $vms | where { $_ | get-NetworkAdapter | where { $_.TYPE -ne "vmxnet3"} })  
{write $vm.name}

Open in new window

0
Comment
Question by:jjoz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 23

Expert Comment

by:Luciano Patrão
ID: 34143093
Hi again :)

I will create you a new script in the end of the day, then I will post it here

Jail
0
 
LVL 71

Accepted Solution

by:
Chris Dent earned 500 total points
ID: 34144045
Hello there,

It depends a little on what you'd like to see exactly. But you can add the Adapter Type as a property to the output:

Get-VM | Select-Object Name, 
  @{n='AdapterType';e={
    $_ | Get-NetworkAdapter | Where-Object { $_.Type -ne "vmxnet3" } | Select-Object -Expand Type }}

Open in new window


Don't forget you can use Export-CSV if you want that pumping out to a file.

HTH

Chris
0
 
LVL 1

Author Closing Comment

by:jjoz
ID: 34161434
Thanks Chris.
0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
LVL 1

Author Comment

by:jjoz
ID: 34161443
@BestWay, many thanks for your efforts in trying to help me man.
0
 
LVL 23

Expert Comment

by:Luciano Patrão
ID: 34162842
Hi

Sorry I have been busy. But glade that you have manage.

Jail
0
 
LVL 1

Author Comment

by:jjoz
ID: 34163690
no worries BestWay, all the best for you in your duty :-)
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If we need to check who deleted a Virtual Machine from our vCenter. Looking this task in logs can be painful and spend lot of time, so the best way to check this is in the vCenter DB. Just connect to vCenter DB(default DB should be VCDB and using…
Ransomware is a malware that is again in the list of security  concerns. Not only for companies, but also for Government security and  even at personal use. IT departments should be aware and have the right  knowledge to how to fight it.
Teach the user how to use configure the vCenter Server storage filters Open vSphere Web Client:  Navigate to vCenter Server Advanced Settings: Add the four vCenter Server storage filters: Review the advanced settings: Modify the values of the four v…
Teach the user how to install log collectors and how to configure ESXi 5.5 for remote logging Open console session and mount vCenter Server installer: Install vSphere Core Dump Collector: Install vSphere Syslog Collector: Open vSphere Client: Config…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question