title: How can I compare CSV to AD users and disable users not in CSV?
body: <p>As a process to disable users, I have a CSV where users are identified by employeeID and not username.  I need to loop through and compare the CSV to AD users, and any AD user not in the CSV needs to be disabled.  This is what I have so far, but it's not working.  I'll admit I'm still fairly new to powershell scripting, so any help would be much appreciated.</p>
  
  <pre><code>Import-Module ActiveDirectory  
  
  Import-Csv -Path c:\ADTerm.csv | foreach {Get-ADUser -filter * -SearchBase "ou=Test,ou=Logins,dc=domain,dc=com" -Identity $_.employeeID} | Where {$_ -ne $null} | Disable-ADAccount -Identity $_.employeeID
  </code></pre>