【发布时间】:2014-12-05 21:14:39
【问题描述】:
我正在尝试通过在 Windows 2008 R2 Standard、PowerShell 2.0 上执行以下命令来清除本地组 test_group 中的所有用户。
Get-ADGroupMember "test_group" | ForEach-Object {Remove-ADGroupMember "test_group" $_ -Confirm:$false}
它抛出以下错误,很可能是因为我使用的是 v2.0?:
“Get-ADGroupMember”一词未被识别为 cmdlet、函数、脚本文件或可运行的程序。检查 名称的拼写,或者如果包含路径,请验证路径 是正确的,然后再试一次。在 line:1 char:18 + Get-ADGroupMember
我从这篇文章及其 cmets 中尝试了许多想法,但我无法得到任何工作,但我不是系统管理员,我不确定我是否没有遗漏什么?: http://blogs.technet.com/b/heyscriptingguy/archive/2009/07/28/hey-scripting-guy-how-do-i-remove-all-group-members-in-active-directory.aspx
请帮忙,我周一要清理大约 300 个组,我不想手动清理...
【问题讨论】:
标签: powershell command-line active-directory