Advertisement
Guest User

Change AD Computer Department Attrib

a guest
Oct 9th, 2015
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <#
  2.  
  3. Script to add in "department" attribute to AD Computers
  4. Created 10.9.15 by Mike Mangene
  5.  
  6. #>
  7.  
  8. $Department = Read-Host "What department are these computers in?"
  9. $Path = Read-Host "What is the path to the file listing of computers?"
  10. $Computers = Get-Content -LiteralPath $Path
  11.  
  12. foreach ($Computer in $Computers){
  13.  
  14.     Set-ADComputer -identity $Computer -Add @{department="$Department"}
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement