################################################################# # This script will help to move bulk ad computer accounts into target OU # Written 08/08/15 Casey, Dedeal # Fell free to change use any part of this script # http://www.smtp25.blogspot.com/ ################################################################# #Importing AD Module Write-Host " Importing AD Module..... " import-module ActiveDirectory Write-Host " Importing Move List..... " # Reading list of computers from csv and loading into variable $MoveList = Import-Csv -Path "C:\tool\move-Computer.csv" # defining Target Path #$TargetOU = 'OU=Computers,OU=VA,DC=TekPros,DC=com' $countPC = ($movelist).count Write-Host " Starting import computers ..." foreach ($Computer in $MoveList){ Write-Host " Moving Computer Accounts..." Get-ADComputer $Computer.CN | Move-ADObject -TargetPath $Computer.TargetOU } Write-Host " Completed Move List " Write-Host " $countPC Computers has been moved " 官方文档:https://gallery.technet.microsoft.com/scriptcenter/Move-AD-Computer-Object-4ed2c5f8 https://gallery.technet.microsoft.com/scriptcenter/Move-AD-Computer-Object-4ed2c5f8#content
- 1
- 粉丝: 0
- 资源: 2
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助