你好,
通常针对获取和删除AD组中的用户可以使用下方powershell命令:
#获取AD组成员
$Users = Get-ADGroupMember GroupName
#删除AD组内成员
Remove-AdGroupMember GroupName –Members $Users
如何用Powershell脚本实现自动移除离职用户的所属组并保存日志
https://blog.csdn.net/weixin_34096182/article/details/91740861
希望对您有帮助,如果回答是有帮助的,
请将其标记为答案,
可以帮助其他有相同问题的社区成员,
并快速找到有用的答复。
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact
tnmff@microsoft.com.