Solved

Modifying Powershell to list VM with certain hardware installed

Posted on 2010-11-16
6
817 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
Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

 
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

Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

Question has a verified solution.

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

My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
Auditing domain password hashes is a commonly overlooked but critical requirement to ensuring secure passwords practices are followed. Methods exist to extract hashes directly for a live domain however this article describes a process to extract u…
Teach the user how to delpoy the vCenter Server Appliance and how to configure its network settings Deploy OVF: Open VM console and configure networking:
Teach the user how to use vSphere Update Manager to update the VMware Tools and virtual machine hardware version Open vSphere Client: Review manual processes for updating VMware Tools and virtual hardware versions: Create a new baseline group in vSp…

695 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