整理一个表,里面只包含address列,address 列是要添加到组的成员地址。
格式如下:
address
[email protected]
[email protected]
......
通过 Exchange Management Console 获取一个成员的添加、删除 Powershell 语句
如下图:
添加
删除
批量添加成员
Import-Csv .\addmember.txt | foreach {Add-DistributionGroupMember -Identity pwc-qgyczlz -Member $_.address -BypassSecurityGroupManagerCheck}
批量移除成员
Import-Csv .\removemember.txt | foreach {Remove-DistributionGroupMember pwc-qgyczlz -Member $_.address -BypassSecurityGroupManagerCheck -Confirm:$false}
时间: 2024-10-08 06:38:55