简体   繁体   English

在O365中使用Powershell批量添加到新地址簿

[英]bulk add to NEW address book with powershell in O365

I have a big list of client email addresses that need to be accessible to all internal employees. 我有一大堆客户电子邮件地址,所有内部员工都必须可以访问。 i have created a new address list to use using: 我创建了一个新的地址列表以使用:

New-addresslist –name “TRH MP List”
New-GlobalAddressList –name “TRH MP List”

the list shows up in my address book in Outlook but says i can't edit it (even though i made myself an admin of it.) 该列表显示在Outlook的通讯簿中,但说我无法对其进行编辑(即使我自己是它的管理员)。

I found this but it seems to only be able to add the main GLOBAL address list. 我发现了这一点,但似乎只能添加主要的GLOBAL地址列表。

Import-Csv C:\ExternalContacts.csv|%{New-MailContact -Name $_.Name -DisplayName $_.Name -ExternalEmailAddress $_.ExternalEmailAddress -FirstName $_.FirstName -LastName $_.LastName}

I've been googling but the above is the only thing that ever turns up. 我一直在谷歌搜索,但是以上是唯一出现过的事情。

I believe what you are looking for is the ability to hide the newly created external contacts from the Global Address List, but still have them be accessible as members of distribution groups. 我相信您正在寻找的是能够从“全局地址列表”中隐藏新创建的外部联系人的功能,但仍可以将其作为通讯组的成员进行访问。

If this is the case, here's the steps (referenced from https://community.office365.com/en-us/w/exchange/579 ) 如果是这种情况,请按照以下步骤操作(从https://community.office365.com/en-us/w/exchange/579引用)

Hide a single external contact 隐藏单个外部联系人

 Set-MailContact <external contact> -HiddenFromAddressListsEnabled $true 

For example, to hide Franz Kohl from the shared address book: 例如,要从共享通讯簿中隐藏Franz Kohl:

 Set-MailContact “Franz Kohl” -HiddenFromAddressListsEnabled $true 

Hide all external contacts 隐藏所有外部联系人

Run the following command to hide all external contacts from the shared address book: 运行以下命令以隐藏共享通讯簿中的所有外部联系人:

 Get-Contact -ResultSize unlimited -Filter {(RecipientTypeDetails -eq 'MailContact')} | Set-MailContact -HiddenFromAddressListsEnabled $true 

After you hide them, external contacts aren't displayed in the shared address book, but you can still add them as members of a distribution group. 隐藏它们之后,外部联系人不会显示在共享通讯簿中,但是您仍然可以将其添加为通讯组的成员。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM