Import-Module ActiveDirectory


$groups = Get-Content C:\VMlists\AD.txt


echo $groups


foreach ($group in $groups)

{


Write-Host "Create $group"


$create = New-ADGroup -Name $group -GroupScope Global -Path "OU=Test,OU=ALL,OU=IT,DC=TEST,DC=NET"


}



DC上运行


Enable-PSRemoting