<?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: Importing vSphere tags from CSV gets incorrectly applied if some values in CSV are empty in VMware PowerCLI Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Importing-vSphere-tags-from-CSV-gets-incorrectly-applied-if-some/m-p/965008#M30308</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you! &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.vmware.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BL&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Mar 2017 21:41:45 GMT</pubDate>
    <dc:creator>BjornJohansson</dc:creator>
    <dc:date>2017-03-15T21:41:45Z</dc:date>
    <item>
      <title>Importing vSphere tags from CSV gets incorrectly applied if some values in CSV are empty</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Importing-vSphere-tags-from-CSV-gets-incorrectly-applied-if-some/m-p/965006#M30306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;vCenter 6.0 and 6.5,&lt;/LI&gt;&lt;LI&gt;PowerCli 6.5 r1&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to import vSphere Tags from a csv into my vCenter and apply this to relevant VM's.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not all VM's should have tags assigned, some should have all tags. The script is applying the latest assigned Tag to the following VM's who are missing have not a Tag specified in the CSV. Please see below for example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script is taken from: &lt;A href="http://www.virtu-al.net/2014/11/13/automating-tags-tag-category-creation-assignment-powercli/" title="http://www.virtu-al.net/2014/11/13/automating-tags-tag-category-creation-assignment-powercli/"&gt;http://www.virtu-al.net/2014/11/13/automating-tags-tag-category-creation-assignment-powercli/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;This is the CSV.&amp;nbsp; The CostCenter "120" will get applied to the VM's under it who are missing the CostCenter Tag info. In this case the bold marked VM's will incorrectly get the CostCenter 120 Tag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Name,SystemOwner,CostCenter,BackupJob&lt;/P&gt;&lt;P&gt;test-vm6,BB,200,backup-Daily&lt;/P&gt;&lt;P&gt;test-vm5,PB,1,backup-Daily&lt;/P&gt;&lt;P&gt;test-srv2,,220,&lt;/P&gt;&lt;P&gt;test-vm3,,200,Backup-weekly&lt;/P&gt;&lt;P&gt;test-vm4,,210,Backup-testing&lt;/P&gt;&lt;P&gt;av-srv2,,666,&lt;/P&gt;&lt;P&gt;test-vm1,,&lt;SPAN style="color: #303030;"&gt;&lt;STRONG&gt;120,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;test-srv1,,,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2012-tpl,,,Backup-manual&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vcenter-01,,,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could just add some dummy info like NoCostCenter, NoBackup, NoOwner to these VM's. But if there is another way it would be great.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;B&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Mar 2017 15:02:29 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Importing-vSphere-tags-from-CSV-gets-incorrectly-applied-if-some/m-p/965006#M30306</guid>
      <dc:creator>BjornJohansson</dc:creator>
      <dc:date>2017-03-15T15:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: Importing vSphere tags from CSV gets incorrectly applied if some values in CSV are empty</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Importing-vSphere-tags-from-CSV-gets-incorrectly-applied-if-some/m-p/965007#M30307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Script isn't accounting for empty tags. Using the script from the original reference, change this line (on or around line 21):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14895973283666338 jive_text_macro" data-renderedposition="50_8_1232_16" jivemacro_uid="_14895973283666338"&gt;&lt;P&gt;$cmdbinfo | Where {$_.($Name) -eq $Tag} | Foreach {&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14895972915149967" data-renderedposition="129_8_1232_16" jivemacro_uid="_14895972915149967"&gt;&lt;P&gt;$cmdbinfo | Where {($tag) -and ($_.($Name) -eq $Tag)} | Foreach {&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and see what you get.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Mar 2017 17:02:49 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Importing-vSphere-tags-from-CSV-gets-incorrectly-applied-if-some/m-p/965007#M30307</guid>
      <dc:creator>kwhornlcs</dc:creator>
      <dc:date>2017-03-15T17:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: Importing vSphere tags from CSV gets incorrectly applied if some values in CSV are empty</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Importing-vSphere-tags-from-CSV-gets-incorrectly-applied-if-some/m-p/965008#M30308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you! &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.vmware.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BL&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Mar 2017 21:41:45 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Importing-vSphere-tags-from-CSV-gets-incorrectly-applied-if-some/m-p/965008#M30308</guid>
      <dc:creator>BjornJohansson</dc:creator>
      <dc:date>2017-03-15T21:41:45Z</dc:date>
    </item>
  </channel>
</rss>

