码迷,mamicode.com
首页 > 系统相关 > 详细

Powershell分享1--动态组,静态组

时间:2018-03-14 14:52:30      阅读:199      评论:0      收藏:0      [点我收藏+]

标签:powershell

一、创建
1.静态组
        New-DistributionGroup  -Name "PingTai"   -Type Distribution
2.动态组
        New-DynamicDistributionGroup   -Name "group" -RecipientContainer "corp.homelink.com.cn/链家网/CFO线/"  -ConditionalCustomAttribute1  "经纪人"  -IncludedRecipients MailboxUsers
3.批量创建动态组
        import-csv C:\Users\fanyunxiao\批量新建动态邮件组.csv  | foreach {New-DynamicDistributionGroup -Name  $_.name  -RecipientContainer  $_.recipientContainer   -ConditionalCustomAttribute1   $_.ConditionalCustomAttribute1  -IncludedRecipients  mailboxusers}

二、添加人员

1.静态组
        import-csv C:\Users\fanyunxiao\批量添加静态组成员.csv | foreach {Add-DistributionGroupMember "group0101" -Member $_.mail}

三、查询动态组人员

            Get-Recipient -RecipientPreviewFilter (Get-DynamicDistributionGroup -Identity **demo@lianjia.com**).LdapRecipientFilter -OrganizationalUnit (Get-DynamicDistributionGroup -Identity **demo@lianjia.com**).RecipientContainer -ResultSize unlimited

Powershell分享1--动态组,静态组

标签:powershell

原文地址:http://blog.51cto.com/fandecorator/2086735

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!