This is an example of using the powershell active-directory module to query directory information.
$pidFile = 'temp.txt' # replace with full path to file foreach($p in get-content $pidFile){ get-aduser -ldapFilter "(employeeid=$p)" -properties employeeid | select samaccountname,employeeid }