Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- foreach ($computer in (Get-Content C:appsdatabase-1.csv)) {
- try{
- $test = Get-ADComputer -Identity $computer -ErrorAction Stop
- if($test){
- Write-Output "$computer" | Out-File C:appsexist.csv -Append
- }
- }catch{
- Write-Output "$computer" | Out-File C:appsNonexist.csv -Append
- }
- }
Add Comment
Please, Sign In to add comment