Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Powershell share 1mo-dynamic group, static group

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

First, create 1. Static group New-DistributionGroup-Name "PingTai"-Type Distribution2. Dynamic group New-DynamicDistributionGroup-Name "group"-RecipientContainer "corp.homelink.com.cn/ Lianjia net / CFO line /"-ConditionalCustomAttribute1 "broker"-IncludedRecipients MailboxUsers3. Create a batch dynamic group import-csv C:\ Users\ fanyunxiao\ batch create a dynamic mail group. Csv | foreach {New-DynamicDistributionGroup-Name $_ .name-RecipientContainer $_ .recipientContainer-ConditionalCustomAttribute1 $_ .ConditionalCustomAttribute1-IncludedRecipients mailboxusers} 2, add personnel 1. Static group

Import-csv C:\ Users\ fanyunxiao\ batch add static group members .csv | foreach {Add-DistributionGroupMember "group0101"-Member $_ .mail}

Third, query the dynamic team personnel

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

Fourth, query static group personnel

Get-ADGroupMember-Identity 'bod'-Recursive | Select-Object Name,SamAccountName | Export-Csv-Path' C:\ Users\ fanyunxiao\ user.csv'-NoTypeInformation-Encoding Unicode

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report