Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <#
- Script to add in "department" attribute to AD Computers
- Created 10.9.15 by Mike Mangene
- #>
- $Department = Read-Host "What department are these computers in?"
- $Path = Read-Host "What is the path to the file listing of computers?"
- $Computers = Get-Content -LiteralPath $Path
- foreach ($Computer in $Computers){
- Set-ADComputer -identity $Computer -Add @{department="$Department"}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement