<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: get the name of Vnic from windows to pwercli in VMware PowerCLI Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/get-the-name-of-Vnic-from-windows-to-pwercli/m-p/2994758#M113772</link>
    <description>&lt;P&gt;Thank you LucD&lt;/P&gt;&lt;P&gt;I'll test this&lt;/P&gt;</description>
    <pubDate>Wed, 08 Nov 2023 18:30:24 GMT</pubDate>
    <dc:creator>guesmi1977</dc:creator>
    <dc:date>2023-11-08T18:30:24Z</dc:date>
    <item>
      <title>get the name of Vnic from windows to pwercli</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/get-the-name-of-Vnic-from-windows-to-pwercli/m-p/2994701#M113763</link>
      <description>&lt;P&gt;hello&amp;nbsp;&lt;BR /&gt;I need to get the name of Vnic (normally named :ethernetx) from windows to pwercli&amp;nbsp;&lt;BR /&gt;can any one help me please&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 13:50:16 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/get-the-name-of-Vnic-from-windows-to-pwercli/m-p/2994701#M113763</guid>
      <dc:creator>guesmi1977</dc:creator>
      <dc:date>2023-11-08T13:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: get the name of Vnic from windows to pwercli</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/get-the-name-of-Vnic-from-windows-to-pwercli/m-p/2994713#M113764</link>
      <description>&lt;P&gt;Try something like this.&lt;BR /&gt;You will have to provide credentials for an account that can logon to the Windows OS.&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;$user = 'domain\user'
$pswd = 'VMware1!'

$cred = New-Object -TypeName PSCredential -ArgumentList $user,(ConvertTo-SecureString -String $pswd -AsPlainText -Force)

$code = @'
Get-NetAdapter | Select Name,@{N='MacAddress';E={$_.MacAddress.Replace('-',':')}} | ConvertTo-Csv
'@

Get-VM -PipelineVariable vm |
ForEach-Object -Process {
  $result = Invoke-VMScript -ScriptText $code -VM $vm -GuestCredential $cred
  Get-NetworkAdapter -VM $vm -PipelineVariable vnic |
  Select @{N='VM';E={$vm.Name}},
    Name,
    @{N='OSName';E={$result.ScriptOutput | ConvertFrom-Csv | where{$_.MacAddress -eq $vnic.MacAddress} | Select -expandProperty Name}}
}&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 08 Nov 2023 14:09:11 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/get-the-name-of-Vnic-from-windows-to-pwercli/m-p/2994713#M113764</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2023-11-08T14:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: get the name of Vnic from windows to pwercli</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/get-the-name-of-Vnic-from-windows-to-pwercli/m-p/2994758#M113772</link>
      <description>&lt;P&gt;Thank you LucD&lt;/P&gt;&lt;P&gt;I'll test this&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 18:30:24 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/get-the-name-of-Vnic-from-windows-to-pwercli/m-p/2994758#M113772</guid>
      <dc:creator>guesmi1977</dc:creator>
      <dc:date>2023-11-08T18:30:24Z</dc:date>
    </item>
  </channel>
</rss>

