title: Need If for checking if AD users are in a String
body: <p>I have a string with all users of the domain, and another with folder permissions (Groups/Users).</p>
  
  <p>I need help with the if statement in my code, it needs to know if any user of the domain is in the string of the Groups/Users that have access to the folder.</p>
  
  <pre><code>if ($allusers -like "DOMAIN\*") {
      $ws.Cells.Item($row, 3).Interior.ColorIndex = 3
      Write-Host "true"
  } else {
      $ws.Cells.Item($row, 3).Interior.ColorIndex = 0 
      write-Host "false"
  }
  </code></pre>
  
  <p>Example of strings:</p>
  
  <p>Folder permissions:</p>
  
  <pre>
  DOMAIN\User1 Allow --  Modify, Synchronize
  DOMAIN\---- Allow   --   ReadAndExecute, Synchronize
  DOMAIN\---- Allow   --   Modify, Synchronize
  DOMAIN\---- Allow   --   Modify, Synchronize
  </pre>
  
  <p>User list:</p>
  
  <pre>
  User1
  User2
  User3
  </pre>
  
  <p>The users come from:</p>
  
  <pre><code>$allusers = Get-ADUser -Filter * -SearchBase "dc=DOMAIN,dc=de" | select Samaccountname
  </code></pre>
  
  <p>And the permissions come from:</p>
  
  <pre><code>$OrdnerAccess = $Folder | Get-Acl | select AccessToString
  </code></pre>
  
  <p>They should both be lists if I'm not mistaken.</p>