Adoray

hostname

May 27th, 2019
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. #vairables
  2. $users = Get-Content "C:\test\fullnames.txt"
  3.  
  4. #script
  5. foreach ($user in $users) {
  6. Get-ADComputer -Filter {Description -Like '*$user*'} -Property Name,Description | Select Name,Description | Export-Csv "C:\test\CompName.csv" -NoTypeInformation
  7. }
Advertisement
Add Comment
Please, Sign In to add comment