title: Lookup value in CSV and return value from 2nd column
body: <p>I'm pulling a server list from SCOM and want to check this list against a CSV which contains the following data:</p>
  
  <pre class="lang-none prettyprint-override"><code>Computername,Collection Name
  Server01,NA - All DA Servers - Patching - Cert - Thu 2:00
  Server02,NA - All DA Servers - Patching - Prod - Wed 18:00
  </code></pre>
  
  <p>If the server is found, return the Collection Name.  I'm just unsure what would be the best approach.</p>
  
  <pre class="lang-psh prettyprint-override"><code>Import-Module OperationsManager
  
  New-SCOMManagementGroupConnection -ComputerName SCOMsvr
  
  $PendReboot = Get-ScomAlert -Criteria "Severity = 1 AND ResolutionState &lt; 254 AND Name = 'Pending Reboot'" |
                Select NetbiosComputerName
  
  $data = Import-Csv .\servers2.csv
  
  $table = $data | Group-Object -AsHashTable -AsString -Property Computername
  </code></pre>
  
  <p><strong>Edit</strong> - second attempt code:</p>
  
  <pre class="lang-psh prettyprint-override"><code>$csv = Import-Csv D:\SCOM-Pend-Reboot.csv
  
  $biglist = Import-Csv D:\servers2.csv
  
  foreach ($line in $csv){
    $server = $line.NetbiosComputerName
  
    if ($server -eq $biglist.Computername) {
      "$server is in $biglist.'Collection Name'"
    } else {
      "$server is not found!"
    }
  }
  </code></pre>