【发布时间】:2018-09-25 06:30:36
【问题描述】:
我有 150 台计算机的列表,我想用 powershell 在活动目录中禁用。
所以我有一个包含计算机名和以下脚本的 csv 文件:
Import-Module ActiveDirectory
$computers = import-csv "C:\temp\test.csv"
foreach ($computer in $computers)
{
$computer | disable-adaccount
$computer | move-adobject -targetpath "OU=Disabled computers, DC=domain, DC=com"
}
出现以下错误:
Disable-ADAccount : The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that take pipeli
ne input.
有人可以帮忙吗?
干杯
【问题讨论】: