Detect the host ESX (redux) version

Hello

We use a script that automatically installs the VM tools on our VMS invited when the OS is installed. We are now mixing our ESX hosting environment so we also well ESX3.5 and ESXi4.0 hosts. Each of these hosts require versions of VM Tool on their customers. I need a way to determine which version of tools to install based on the version of ESX VM client runs on.

I've seen other threads on this and suggested using the date of the BIOS, but I'm not real keen on this approach.

What I found in our environment is the "Device Instance path" or "The device Instance ID" of different NIC appear compatible subprovider IDs that begin with \3 when it is hosted on ESX3.5 and \4 or \FF when it is hosted on ESX 4.0

i.e.

ESX 3.5 hosted vm - NIC device Instance path = PCI VEN_8086 & DEV_100F & SUBSYS_075015AD & REV_01\3 & 2B8E0B4B & 0 & 88

ESXi 4.0hosted vm - NIC device Instance path = PCI VEN_8086 & DEV_100F & SUBSYS_075015AD & REV_01\4 & B70F118 & 0 & 0088

Note the key differentiating field is immediately after the second "\".

Anyone have any ideas if this logic will hold up over time?

Hello

I wouldn't count on that, but if it works now, go ahead. It may not be the same as we go along.

However it is a pretty good test 'red pill '. The virtual hardware is very revealing and it's trivially easy to determine the version of ESX, the virtual machine is hosted using red pill techniques.

Best regards
Edward L. Haletky VMware communities user moderator, VMware vExpert 2009

Now available: url = http://www.astroarch.com/wiki/index.php/VMware_Virtual_Infrastructure_Security'VMware vSphere (TM) and Virtual Infrastructure Security' [/ URL]

Also available url = http://www.astroarch.com/wiki/index.php/VMWare_ESX_Server_in_the_Enterprise"VMWare ESX Server in the enterprise" [url]

Blogs: url = http://www.virtualizationpractice.comvirtualization practice [/ URL] | URL = http://www.astroarch.com/blog Blue Gears [url] | URL = http://itknowledgeexchange.techtarget.com/virtualization-pro/ TechTarget [url] | URL = http://www.networkworld.com/community/haletky Global network [url]

Podcast: url = http://www.astroarch.com/wiki/index.php/Virtualization_Security_Round_Table_Podcastvirtualization security Table round Podcast [url] | Twitter: url = http://www.twitter.com/TexiwillTexiwll [/ URL]

Tags: VMware

Similar Questions

  • Not able to connect to the host ESX 3.5 by VC so customer VI

    The host ESX 3.5 has been disconnected from the VC, and we are not able to connect customer using VI as well. The virtual machines on the host are running without any problem.

    Got the message when tried to restart/start services of Mgmt. below

    # Service mgmt-vmware restart

    stopping VMware ESX Server management services:

    VMware ESX Server Host Agent Watchdog

    VMware ESX Server host agent

    Starting VMware ESX Server management services:

    Agent Host VMware ESX Server (background)

    Availability report startup (background)/etc/init.d/mgmt-vmware: fork: Resource temporarily unavailable.)

    # Start of Service mgmt-vmware

    From the VMware ESX Server management services:

    VMware ESX servre Agent Host (background)

    Availability report startup (background)

    status of service mgmt-vmware #.

    VMware-pass is stopped

    hostd.log - entries

    /etc/init.d/sshd command failed

    Didn't the /etc/init.d/sshd fork: Resource temporarily unavailable.

    Let us know the fix for this problem other than restarting the host.

    To know how to clean it, please read KB1007887 - defunct cimservera of process on VMware ESX 3.5 hardware management agents run and follow the instructions.

    André

  • How to remove the host esx 3.5 virtual Center

    Can't find info on how to do to remove the host esx virtual center.

    How to do?

    THX.

    Right-click on your host in the left pane and click Disconnect and then once it is disconnected you can right click on the host again and click on Remove and which removes the host to vCenter.

    =========================================================================

    William Lam

    VMware vExpert 2009

    Scripts for VMware ESX/ESXi and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

    repository scripts vGhetto

    http://Twitter.com/lamw

    If you find this information useful, please give points to "correct" or "useful".

  • How to get the host ESX DR see replicated Celerra Lun

    Hi guys, Im setting up SRM with 2 x NS20 and ive got regarding the configuration of the LUN on the production storage array, Lun on the storage LUN appropriate to prod/dr esx servers present DR Bay. Ive set up replication and added the DR lun to the esx server, ensuring not to add it as he will write a signature. I've then added the production on the production ESX Server LUNs, added storage which obviously writes a signature on the drive, and with the installation of the replication, I expected to simply issue a new analysis on the DR esx host and do see the data store.

    Am I missing something here? Any help would be appreciated.

    Thank you

    Hello

    "On DR NS ive done exactly the same thing with respect to FS, Lun, target iSCSI and presented to the host ESX DR, ive done a rescan and his picked up the lun 'Read Only', which is being replicated in but the tab of summary in VC, I see that the local VMFS file system and I was expecting to see the replicated LUN listed with the store local data or is this seen only". When SRM changes the properties of Lun during a failover? »

    You will not see the Site recovery volumes listed in data warehouses, unless you do one of two things - a failover in which case the production side will be unalterable and be removed from the list of data on the Production side store while exposing the VMFS data store now read-write on the side of the recovery.

    Or you use the test function in which case that encourage a wink of Celerra temporary writable and it will appear as a data store broken in the list on the side of the recovery VMFS data warehouses.

    However, it seems that you do not see this result, as DR table does not seem to be configured as it should.

    Can the side Production VC communicate with happiness with the Celerra recovery site - IE can launch you a session PUTTY from the Production side VC and connect to recovery side Celerra. Can the recovery side VC do the same thing for the Production side Celerra?

    I guess you get the unknown peer after that MRS. not the discovery of the table that owns about 23% forever and then ends. The only other thing I can think of and am not sure about this as a solution because it is a set of actions that I did of my side of recovery when Celerra is to create a small file system and in a small iSCSI LUN on the side of the recovery of the recovery side Celerra and put it in your recovery ESX cluster side - create a file system VMFS on it and place a Virtual computer in this VMFS file system - this is to check that there are no problems with the ESX host side recovery working with the recovery side Celerra

    My guess would be a thing of IP connectivity - if it's a little strange, if the link between the Production side VC and the recovery side VC has been established successfully

    I'll pass on to a colleague to VMware SRM and see if he has any ideas

    Concerning

    Alex Tanner

  • Run the host ESX 4.1 in vCenter 5.0

    Hello everyone, I have a simple question.   I am running 4.1 U1 ESX hosts and vCenter 4.1.  I need to upgrade to ESX 4.1 U2.   I know I need to improve my vCenter to match my version of ESX host, but I thought I killed a stone 2 strokes.   I have the license for vCenter and ESX 5.0 but I'm programmed to upgrade next year.   Given that I have to upgrade my vCenter anyway can I go to version 5.0 and run my ESX host on v 4.1 U1 without any loss of functionality?

    I would like to upgrade everything at once, but the company needs me to complete the test first upgrade of the host is not an option at this time.

    Thanks for your help with this.

    Hello

    You shouldn't lose any features with what you described.  Remember however that in one year, you will still need to patch vCenter to upgrade to the latest version 5.x.

    Thank you

    Jeff

  • The IP of the host ESX and ESXi console information

    Hi guys,.

    I have a little problem here, we have a script that collects the host Console IP, host name, field info... etc.

    My problem is with the period of INVESTIGATION, because we have a mixed environment of esx3.5, esx4.0, esx4.1 and ESXi4 get the IP of the Console is a bit of a problem.

    If I use the

    $NicInfo = get-VMHostNetwork - VMHost $esxhost. Name
    $newesxhost. VmHostName = $NicInfo.HostName
    $newesxhost. Domain = $NicInfo.DomainName
    {foreach ($cs in $NicInfo.ConsoleNic)}
    $newesxhost. IPAddress = [string] $cs. INTELLECTUAL PROPERTY
    }

    I covers the ESX Console hosts IP info, but all the info of ESXi IP gets missed.

    If I add to the:

    $NicInfo = get-VMHostNetwork - VMHost $esxhost. Name
    $newesxhost. VmHostName = $NicInfo.HostName
    $newesxhost. Domain = $NicInfo.DomainName
    foreach ($cs in $NicInfo. ) VirtualNic | where {$_.name - eq "vmk0"}){}
    $newesxhost. IPAddress = [string] $cs. INTELLECTUAL PROPERTY
    }

    I get the ESXi IP Management IP network, but the ESX hosts to report the vmk0 which is the IP address of vmotion.

    So if anyone can help I'd be very happy.

    Include the HOST party so that you can see what I mean:

    #[int] $Loopctr = 0
    $newesxhost = (@($xml.) (ESXInventory.HOST) [0])
    $newVMPortGroup = (@($xml.) (ESXInventory.VMPortGroup) [0])

    Get-VMHost-location (Get-Cluster-name $cluster. Name) | Sort-Object-unique | % {
    $esxhost = get-view $_.ID
    Write-Host $esxhost. Name
    #if ($Loopctr - gt 0) {$newesxhost = $newesxhost.clone ()}
    $newesxhost = $newesxhost.clone)
    $newesxhost. MemberOfCluster = $cluster. Name
    $newesxhost. Name of the vendor = $esxhost. Summary.Hardware.Vendor
    $newesxhost. Model = $esxhost. Summary.Hardware.Model
    $newesxhost.os_version = [string] $esxhost. Config.Product.Version
    $newesxhost.os_build = [string] $esxhost. Config.Product.Build
    $newesxhost.os_caption = [string] $esxhost. Config.Product.FullName
    $newesxhost. MemorySize = [string] $esxhost. Summary.Hardware.MemorySize
    $newesxhost. CpuModel = $esxhost. Summary.Hardware.CpuModel
    $newesxhost. CpuMhz = [string] $esxhost. Summary.Hardware.CpuMhz
    $newesxhost. NumCpuPkgs = [string] $esxhost. Summary.Hardware.NumCpuPkgs
    $newesxhost. NumCpuCores = [string] $esxhost. Summary.Hardware.NumCpuCores
    $newesxhost. NumCpuThreads = [string] $esxhost. Summary.Hardware.NumCpuThreads
    $newesxhost. NumNics = [string] $esxhost. Summary.Hardware.NumNics

    $newesxhost. NumHBAs = [string] $esxhost. Summary.Hardware.NumHBAs

    $NicInfo = get-VMHostNetwork - VMHost $esxhost. Name
    $newesxhost. VmHostName = $NicInfo.HostName
    $newesxhost. Domain = $NicInfo.DomainName
    foreach ($cs in $NicInfo.VirtualNic | where {$_.name - eq "vmk0"}) {}
    $newesxhost. IPAddress = [string] $cs. INTELLECTUAL PROPERTY
    }

    $VMPortGroup = get-VirtualPortGroup - VMHost $esxhost. Name

    {foreach ($vpg to $VMPortGroup)
    Write-Host $vpg. Name
    $newVMPortGroup = $newVMPortGroup.clone)
    $newVMPortGroup.Name = $vpg. Name
    $xml. ESXInventory.AppendChild ($newVMPortGroup) > $null
    }

    $xml. ESXInventory.AppendChild ($newesxhost) > $null
    #$Loopctr += 1

    /regards

    Why you do not include a test that check if the host's ESX or ESXi?

    Something like that

    $esx = Get-VMHost MyESX
    
    $NicInfo = Get-VMHostNetwork -VMHost $esx 
    
    $newesxhost.VmHostName = $NicInfo.HostName$newesxhost.Domain = $NicInfo.DomainName
    
    if($esx.Extensiondata.Config.Product.ProductLineId -eq "esx"){    foreach ($cs in $NicInfo.ConsoleNic ){        $newesxhost.IPAddress = [string] $cs.IP    }}else{    foreach ($cs in $NicInfo.VirtualNic |where {$_.name -eq "vmk0"} ){        $newesxhost.IPAddress = [string] $cs.IP    }}
    
    $newesxhost
    
  • How to find the host ESX 4.1 SCSI tape drive card information...

    Dear team,

    last night we have installed card scsi tape drive on one of the host to ESX 4.1, just want to know how to find the details of scsi card in ESX 4.1 host, is possible to find via cli or hardware status tab?

    need help on the same.

    concerning

    Mr. VMware

    Hello

    You should find the information you are looking for by entering the following command.

    less/proc/scsi/aic79xx/6

    Kind regards

    Ralf

  • Migrate the host ESX to vSphere 4.0 Server 4.1

    Hi all

    I have 2 vSphere environments. A server vSphere 4.0, and 3 ESX 4.0 host. Another with vSphere 4.1 server with 3 hosts ESXi 4.1. I want to migrate ESX 4.0 mailboxes to the new server for vSphere 4.1. Assuming that I have licenses installed locally on the boxes, and I squared away vSphere licensing, what would be the best way to migrate the host?

    I would simply ' right click-> delete ', then 'right click-> add a host' on the Server 4.1?

    Thanks in advance.

    the best way to do so is in vCenter 1, right-click and disconnect the host and then delete host.  In vCenter2, "add host".  This will move the hosts and their guests to the new instance without interruption.

  • NAT network between the host ESX with DVS

    Hello.

    In my test of vSphere 4, I have two ESX hosts. I want to share an IP address between all the virtual machines on these two ESX hosts. In this regard, I have a virtual machine that acts as a NAT router. This virtual machine has two network that is connected to each their own vNetwork Distributed Switch connection. We have a physical NIC (on each ESX host) which has the Internet connection. The other has no physical network connection.

    To test if it works I created a VM test on both ESX hosts. The system works on the virtual machine that is on the same ESX host as the virtual machine that acts as a NAT router is located, but not the virtual machine on the other ESX host. The other VM have no contact with the router and receives no DHCP data.

    Any suggestions? I know I did something wrong because DVS is new to me, but I really want this to work.

    Hello

    That ends up being a vNetwork design more than anything even with vDS. For example, if you have a NAT that works for all your hosts you would then have a NAT virtual appliance such as:

    PSwitch external network <->Teddy <->vSwitch <->vPG <->NAT VM <->vPG <->vSwitch <->Teddy <->network internal pSwitch

    Now the vSwitches in the above can be traditional vSwitches or vDS' the key is that the "seconds" vSwitch must be connected on the same vSwitch on all other hosts, so it has an uplink to a physical switch that is also connected to all other hosts. vDS does NOT lighten your vNetwork is the need of cable to allow the communication of the VM.

    The VM NAT can move from host to host as long as there is communication to this virtual machine on each host on each network in this case, the external network and internal.

    Best regards
    Edward L. Haletky VMware communities user moderator, VMware vExpert 2009

    Now available: url = http://www.astroarch.com/wiki/index.php/VMware_Virtual_Infrastructure_Security'VMware vSphere (TM) and Virtual Infrastructure Security' [/ URL]

    Also available url = http://www.astroarch.com/wiki/index.php/VMWare_ESX_Server_in_the_Enterprise"VMWare ESX Server in the enterprise" [url]

    Blogs: url = http://www.virtualizationpractice.comvirtualization practice [/ URL] | URL = http://www.astroarch.com/blog Blue Gears [url] | URL = http://itknowledgeexchange.techtarget.com/virtualization-pro/ TechTarget [url] | URL = http://www.networkworld.com/community/haletky Global network [url]

    Podcast: url = http://www.astroarch.com/wiki/index.php/Virtualization_Security_Round_Table_Podcastvirtualization security Table round Podcast [url] | Twitter: url = http://www.twitter.com/TexiwillTexiwll [/ URL]

  • vCenter Agent does not update the host esx

    After the Victoria Cross to vCenter4, I got a message from vCenter saying the 'update cannot the specific host... ". »

    Is there anyway that I can check the version to ensure that it is the match with my vCenter and how do I update this please.

    Thank you

    You can connect to the host using ssh and run the command as root to obtain the vpxa version: "rpm - qa | grep vpxa.

    Sandeep-

  • How to get the MAC address for the physical NETWORK adapter of the HOST ESX (vmnic0/vmnic1)

    I can recover physical NIC details for the server HOST ESX, but MAC is empty... How can I get?

    Thank you/HKS

    $net = get-VMHostNetwork - VMHost myServer.domain.net

    $net | FC

    class VMHostNetworkInfoImpl

    {

    VMKernelGateway = 166.12.113.1

    ConsoleGateway = 166.12.113.1

    ConsoleGatewayDevice = vswif0

    DnsAddress =

    [

    169.40.0.2

    169.40.0.1

    ]

    DnsFromDhcp = False

    DnsDhcpDevice =

    DomainName = domaine.net

    Host name = hostname1

    SearchDomain =

    [

    EU.hedani.NET

    ]

    PhysicalNic =

    [

    class PhysicalNicImpl

    {

    BitRatePerSec = 1000

    FullDuplex = True

    WakeOnLanSupported =

    ID = key - vim.host.PhysicalNic - vmnic0

    DeviceName = vmnic0

    Mac =

    DhcpEnabled = False

    IP =

    SubnetMask =

    }

    class PhysicalNicImpl

    {

    BitRatePerSec = 0

    FullDuplex = False

    WakeOnLanSupported =

    ID = key - vim.host.PhysicalNic - vmnic1

    DeviceName = vmnic1

    Mac =

    DhcpEnabled = False

    IP =

    SubnetMask =

    }

    ]

    VirtualSwitch =

    [

    class VirtualSwitchImpl

    {

    Key = key - vim.host.VirtualSwitch - vSwitch0

    Name = vSwitch0

    NumPorts = 128

    NumPortsAvailable = 105

    NIC =

    [

    vmnic1

    vmnic0

    ]

    MTU =

    }

    class VirtualSwitchImpl

    {

    Key = key - vim.host.VirtualSwitch - vSwitch1

    Name = vSwitch1

    NumPorts = 64

    NumPortsAvailable = 56

    NIC =

    MTU =

    }

    class VirtualSwitchImpl

    {

    Key = key - vim.host.VirtualSwitch - vSwitch2

    Name = vSwitch2

    NumPorts = 64

    NumPortsAvailable = 64

    NIC =

    MTU =

    }

    ]

    ConsoleNic =

    [

    class HostConsoleVirtualNicImpl

    {

    PortGroupName = Service_Console_VLAN1

    ID = key - vim.host.VirtualNic - vswif0

    DeviceName = vswif0

    Mac = 00:50:56:4 c: 1 d: 3B

    DhcpEnabled = False

    IP = 111.11.111.11

    Subnet mask = 255.255.255.0

    }

    class HostConsoleVirtualNicImpl

    {

    PortGroupName = Service_Console_ISOL

    ID = key - vim.host.VirtualNic - vswif1

    DeviceName = vswif1

    Mac = 00:50:56:4 d: 88:87

    DhcpEnabled = False

    IP = 10.0.0.241

    Subnet mask = 255.255.255.0

    }

    ]

    VirtualNic =

    [

    class HostVMKernelVirtualNicImpl

    {

    VMotionEnabled = True

    PortGroupName = Vmotion_VLAN1

    ID = key - vim.host.VirtualNic - portgroup3

    DeviceName = portgroup3

    Mac = 00:50:56:65:04:56

    DhcpEnabled = False

    IP = 166.12.113.72

    Subnet mask = 255.255.255.0

    }

    ]

    }

    get-vmhost | % {(get-view $_.id).config.network.pnic} | select Device, Mac
    

    http://www.vmwarescripting.com

  • mutex slow performance in windows xp on the host ESX 5 prompt

    I've done a few consumer casual producer marks written in C with visual studio 2005 on dual core 2 ghz cpu, with processor type and identical win xp professional o.s., it seems to me on ESX, execution mutex, events and corresponding waitforsingleobject is 1/10th to 1/2 the speed on the physical machine, Windows 7 instead the performance is about half of the corresponding physical machine I was wondering if anyone else noticed, this is perhaps due to how mutex/criticism sections/events/semaphores are emulated in the ESX binary translation, there are all the settings of windows xp 32 bits comments under ESX 5 to allow especially stimulate the sync speed of process/thread to make it similar to a physical machine may?

    I am attaching a small test project for vs 2005 in case anyone could take the trouble to try and compare the pure speed of physical synchronization primitives and ESX especially if in win xp there is a penalty of macroscopic speed or maybe I did something wrong as I ran the test on an overloaded perhaps ESX.

    gf111 wrote:

    Is it possible to wake up another process in win xp without incurring TPR registry bashing?

    I do not know.  It is not clear to me why Windows wants to change the TPR in the first place.  The TPR is to block external interruptions, and I see not why Windows would change the external interrupts are blocked, according to what level process user is active.

    I noticed that windows 7 synchronization is much faster on the same ESX with FlexPriority probably not activated, likely due to 'Lazy TPR', which I believe has been implemented in o.s. later than xp, so I guess that the more realistic prospect is to go with win 7, given I don't think that in my particular environment , I'm working on they would be willing to risk life and limb with potentially unstable FlexPriority bios patcher, has taken the fact that xp is end of life taken into charge anyway, but thanks for giving me a clue what may happen anyway.

    Windows XP 64-bit is another option.  He always denigrated on the TPR, but uses instead of MMIO CR8. (AMD hotfix did the same thing with an ISA AMD extension that allows the code to 32-bit access CR8.)

    Note also that FlexPriority is not a panacea.  It can reduce the cost of a TPR of 2000 update ~ cycles to ~ 400 cycles, but it is still far from what it costs in native mode, which is of ~ 2 cycles.

    Binary translation, TPR updates are rather cheap, but BT has its own performance issues.

    Your Windows XP guest running with binary translation or hardware-assisted virtualization?  You can check the file for 'HV Settings' vmware.log know.

  • How to restart a service on the host esx with vi toolkit

    It is possible to restart the services esx (such as syslogd, hpasm hpsmhd) via a script Powershell uses the VI API?

    I have a powershell script that calls plink.exe to do, but I'd rather not use plink.

    As far as I know, there is no such API.

    There is the Start-VmHostService cmdlet, but it's only for a very limited set of services (ntpd, sshd, vmware-vpxa).

  • Update the host ESX 4.1 before upgrading vCenter 4.0 to 4.1

    Someone sees a problem updating my 4.1 ESX hosts and leaving in the former vCenter 4 Update 1 cluster?  I have rebuilt a new server vCenter 4.1 but can't stop the virtual machines and ESX hosts in maintenance until tomorrow night mode.  I want to put the ESX host in maintenance mode, both in the old server vCenter and 4.1 update and move remove/add new vCenter tomorrow night.

    You can't manage a host ESXi4.1 with nothing less than vCenter4.1.  If your plan will not work.  You must first upgrade vCenter.

    http://www.VMware.com/PDF/vSphere4/R40/vsp_compatibility_matrix.PDF

  • Need to powershell script to gather the host ESX Info network

    Hello

    I need two scripts powershell to collect two types of information about the ESX host network.

    1. information vNIC -& gt; information on the vmnic (physical ESX host network adapter) connected to vSwitches.

    vNIC | VSwitch model | | Trade | Speed | Status | | PCI slot Active/stand-by/not assigned

    (Example) output expected:

    vmnic0 | intel corporation 82XXXX gigabit ethernet controller | vSwitch0 | service console, vMotion | 1000mbps Full | up 01:01.00 | | Assets

    2. Portgroup information

    PortGroup | vNIC (s) with active / standby |  PCI slot of vNIC (s) with active / standby | Physical switch with port number

    Expected results (example):

    Service console | vmnic0 (a) : (s) | 01 vmnic1: 00. 00 (a) : 02:00. 00 (s) | abcd-123 [GigabitEthernet10/10] : xyzf-7890 [Gigabitethernet11/11]

    Please note if CDP is not active, then in the field of physical switch values can contain "CDP is not enabled"

    Thanks in advance!

    Noticed that the two threads under became a little mixed in the script.

    This is the script with the devIds with the indication of the active / standby.

    foreach($esxImpl in (Get-VMHost)){
         $esx = $esxImpl | Get-View
         $netSys = Get-View $esx.ConfigManager.NetworkSystem
         foreach($pg in $esx.Config.Network.Portgroup){
              $pNICStr = @()
              $pciStr = @()
              $cdpStr = @()
              foreach($a in $pg.ComputedPolicy.NicTeaming.NicOrder.ActiveNic){
                   if($a){
                        $pNICStr += ($a + "(a)")
                        $pciStr += ($esx.Config.Network.Pnic | where {$_.Device -eq $a} | %{$_.Pci + "(a)"})
                        $cdpInfo = $netSys.QueryNetworkHint($a)
                        $cdpStr += &{if($cdpInfo[0].connectedSwitchPort){$cdpInfo[0].connectedSwitchPort.devId + "(a)"}else{"CDP not configured(a)"}}
                   }
              }
              foreach($s in $pg.ComputedPolicy.NicTeaming.NicOrder.StandbyNic){
                   if($s){
                        $pNICStr += ($s + "(s)")
                        $pciStr += ($esx.Config.Network.Pnic | where {$_.Device -eq $s} | %{$_.Pci + "(s)"})
                        $cdpInfo = $netSys.QueryNetworkHint($s)
                        $cdpStr += &{if($cdpInfo[0].connectedSwitchPort){$cdpInfo[0].connectedSwitchPort.devId + "(s)"}else{"CDP not configured(s)"}}
                   }
              }
    
              $pg | Select @{N="ESXname";E={$esxImpl.Name}},
              @{N="Portgroup";E={$pg.Spec.Name}},
              @{N="VLANid";E={$pg.Spec.VlanId}},
              @{N="pNIC";E={$pNICStr}},
              @{N="PCI location";E={$pciStr}},
              @{N="Physical switch";E={$cdpStr}}
         }
    }
    

    ____________

    Blog: LucD notes

    Twitter: lucd22

Maybe you are looking for