Guest User

Untitled

a guest
Jan 21st, 2019
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. foreach ($computer in (Get-Content C:appsdatabase-1.csv)) {
  2. try{
  3. $test = Get-ADComputer -Identity $computer -ErrorAction Stop
  4. if($test){
  5. Write-Output "$computer" | Out-File C:appsexist.csv -Append
  6. }
  7. }catch{
  8. Write-Output "$computer" | Out-File C:appsNonexist.csv -Append
  9. }
  10. }
Add Comment
Please, Sign In to add comment