批量移动AD,Computer到指定OU

时间:2022-07-21 14:29:10
【文件属性】:
文件名称:批量移动AD,Computer到指定OU
文件大小:801B
文件格式:7Z
更新时间:2022-07-21 14:29:10
Active Directory ################################################################# # 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
【文件预览】:
Bulk Computer move
----Move_AD_Computer_Accounts_from_CSV_File-2.ps1(1008B)
----move-Computer.csv(91B)

网友评论