New-DynamicDistributionGroup

 

適用版本: Exchange Server 2007 SP3, Exchange Server 2007 SP2, Exchange Server 2007 SP1

上次修改主題的時間: 2009-05-12

使用 New-DynamicDistributionGroup 指令程式可以建立新的動態通訊群組。

語法

New-DynamicDistributionGroup -Name <String> -IncludedRecipients <Nullable> [-Alias <String>] [-ConditionalCompany <MultiValuedProperty>] [-ConditionalCustomAttribute1 <MultiValuedProperty>] [-ConditionalCustomAttribute10 <MultiValuedProperty>] [-ConditionalCustomAttribute11 <MultiValuedProperty>] [-ConditionalCustomAttribute12 <MultiValuedProperty>] [-ConditionalCustomAttribute13 <MultiValuedProperty>] [-ConditionalCustomAttribute14 <MultiValuedProperty>] [-ConditionalCustomAttribute15 <MultiValuedProperty>] [-ConditionalCustomAttribute2 <MultiValuedProperty>] [-ConditionalCustomAttribute3 <MultiValuedProperty>] [-ConditionalCustomAttribute4 <MultiValuedProperty>] [-ConditionalCustomAttribute5 <MultiValuedProperty>] [-ConditionalCustomAttribute6 <MultiValuedProperty>] [-ConditionalCustomAttribute7 <MultiValuedProperty>] [-ConditionalCustomAttribute8 <MultiValuedProperty>] [-ConditionalCustomAttribute9 <MultiValuedProperty>] [-ConditionalDepartment <MultiValuedProperty>] [-ConditionalStateOrProvince <MultiValuedProperty>] [-Confirm [<SwitchParameter>]] [-DisplayName <String>] [-DomainController <Fqdn>] [-OrganizationalUnit <OrganizationalUnitIdParameter>] [-RecipientContainer <OrganizationalUnitIdParameter>] [-TemplateInstance <PSObject>] [-UseRusServer <String>] [-WhatIf [<SwitchParameter>]]

New-DynamicDistributionGroup -Name <String> -RecipientFilter <String> [-Alias <String>] [-Confirm [<SwitchParameter>]] [-DisplayName <String>] [-DomainController <Fqdn>] [-OrganizationalUnit <OrganizationalUnitIdParameter>] [-RecipientContainer <OrganizationalUnitIdParameter>] [-TemplateInstance <PSObject>] [-UseRusServer <String>] [-WhatIf [<SwitchParameter>]]

詳細描述

動態通訊群組會查詢 Active Directory 目錄服務擁有郵件功能的物件,並根據結果建立群組成員。每當電子郵件送至群組時,就會重新計算群組成員。Exchange 提供的查詢篩選是限制為下列參數的任意組合:

  • ConditionalCompany

  • ConditionalCustomAttribute N (其中 N 為 1 到 15 的值)

  • ConditionalDepartment

  • ConditionalStateOrProvince

  • IncludedRecipients

您也可以使用 RecipientFilter 參數建立任何自訂查詢。

若要執行 New-DynamicDistributionGroup 指令程式,必須對您使用的帳戶委派下列項目:

  • Exchange 收件者系統管理員角色

如需管理 Microsoft Exchange Server 2007 所需之權限、委派角色及權利的相關資訊,請參閱權限考量

參數

參數 必要 類型 描述

IncludedRecipients

必要

System.Nullable

IncludedRecipients 參數可篩選用來建立動態通訊群組的收件者類型。如果已指定 RecipientFilter 參數,則無法使用 IncludedRecipients 參數。

IncludedRecipients 參數可用的值有 AllRecipients、MailboxUsers、Resources、MailContacts、MailGroups、Mail Users 及 None。

AllRecipients 只有它自己才可以使用。以逗點隔開 IncludedRecipients 的多個值時,會套用 OR 布林運算子。

Name

必要

System.String

Name 參數指定動態通訊群組的名稱。如果未指定 DisplayName 參數,則也會將 Name 的值用於 DisplayName

Name 值不可超過 64 個字元。

如果 NameDisplayName 的值不同:

  • Name 指定 Active Directory 使用者和電腦中的動態通訊群組名稱,以及 Exchange 管理主控台之 [群組名稱] 欄位中的動態通訊群組名稱。

  • DisplayName 指定 Exchange 管理主控台及 Exchange 全域通訊清單 (GAL) 中的動態通訊群組名稱。

RecipientFilter

必要

System.String

RecipientFilter 參數可篩選用來建立動態通訊群組之擁有郵件功能的收件者。如果指定下列任一參數,則無法使用 RecipientFilter

  • IncludedRecipients

  • ConditionalCompany

  • ConditionalCustomAttribute 其中 N (N 為 1 到 15 的值)

  • ConditionalDepartment

  • ConditionalStateOrProvince

RecipientFilter 使用 OPath 語法來查詢 Active Directory 並篩選收件者。

如需可過濾內容的相關資訊,請參閱 -RecipientFilter 參數的可過濾內容

Alias

選用

System.String

Alias 參數指定動態通訊群組的別名。Alias 的值是用來產生動態通訊群組的主要簡易郵件傳送通訊協定 (SMTP) 電子郵件地址。Alias 的值不可包含空格。如果未指定 Alias 參數,則會將 Name 參數的值當成 Alias 參數的值,而 Name 參數中的所有空格都會轉換成底線字元 (_)。

ConditionalCompany

選用

Microsoft.Exchange.Data.MultiValuedProperty

ConditionalCompany 參數可篩選用來建立動態通訊群組的信箱使用者或擁有郵件功能的連絡人。

ConditionalCompany 參數的多個值以逗號隔開時,會套用 OR 布林運算子。

ConditionalCustomAttribute1

選用

Microsoft.Exchange.Data.MultiValuedProperty

ConditionalCustomAttribute1 參數指定自訂的屬性。您可以使用這些屬性來儲存其他資訊。

ConditionalCustomAttribute10

選用

Microsoft.Exchange.Data.MultiValuedProperty

ConditionalCustomAttribute10 參數指定自訂的屬性。您可以使用這些屬性來儲存其他資訊。

ConditionalCustomAttribute11

選用

Microsoft.Exchange.Data.MultiValuedProperty

ConditionalCustomAttribute11 參數指定自訂的屬性。您可以使用這些屬性來儲存其他資訊。

ConditionalCustomAttribute12

選用

Microsoft.Exchange.Data.MultiValuedProperty

ConditionalCustomAttribute12 參數指定自訂的屬性。您可以使用這些屬性來儲存其他資訊。

ConditionalCustomAttribute13

選用

Microsoft.Exchange.Data.MultiValuedProperty

ConditionalCustomAttribute13 參數指定自訂的屬性。您可以使用這些屬性來儲存其他資訊。

ConditionalCustomAttribute14

選用

Microsoft.Exchange.Data.MultiValuedProperty

ConditionalCustomAttribute14 參數指定自訂的屬性。您可以使用這些屬性來儲存其他資訊。

ConditionalCustomAttribute15

選用

Microsoft.Exchange.Data.MultiValuedProperty

ConditionalCustomAttribute15 參數指定自訂的屬性。您可以使用這些屬性來儲存其他資訊。

ConditionalCustomAttribute2

選用

Microsoft.Exchange.Data.MultiValuedProperty

ConditionalCustomAttribute2 參數指定自訂的屬性。您可以使用這些屬性來儲存其他資訊。

ConditionalCustomAttribute3

選用

Microsoft.Exchange.Data.MultiValuedProperty

ConditionalCustomAttribute3 參數指定自訂的屬性。您可以使用這些屬性來儲存其他資訊。

ConditionalCustomAttribute4

選用

Microsoft.Exchange.Data.MultiValuedProperty

ConditionalCustomAttribute4 參數指定自訂的屬性。您可以使用這些屬性來儲存其他資訊。

ConditionalCustomAttribute5

選用

Microsoft.Exchange.Data.MultiValuedProperty

ConditionalCustomAttribute5 參數指定自訂的屬性。您可以使用這些屬性來儲存其他資訊。

ConditionalCustomAttribute6

選用

Microsoft.Exchange.Data.MultiValuedProperty

ConditionalCustomAttribute6 參數指定自訂的屬性。您可以使用這些屬性來儲存其他資訊。

ConditionalCustomAttribute7

選用

Microsoft.Exchange.Data.MultiValuedProperty

ConditionalCustomAttribute7 參數指定自訂的屬性。您可以使用這些屬性來儲存其他資訊。

ConditionalCustomAttribute8

選用

Microsoft.Exchange.Data.MultiValuedProperty

ConditionalCustomAttribute8 參數指定自訂的屬性。您可以使用這些屬性來儲存其他資訊。

ConditionalCustomAttribute9

選用

Microsoft.Exchange.Data.MultiValuedProperty

ConditionalCustomAttribute9 參數指定自訂的屬性。您可以使用這些屬性來儲存其他資訊。

ConditionalDepartment

選用

Microsoft.Exchange.Data.MultiValuedProperty

ConditionalDepartment 參數可篩選用來建立動態通訊群組的信箱使用者或擁有郵件功能的連絡人。如果已指定 RecipientFilter 參數,則無法使用 ConditionalDepartment

以逗點隔開 ConditionalDepartment 的多個值時,會套用 OR 布林運算子。

ConditionalStateOrProvince

選用

Microsoft.Exchange.Data.MultiValuedProperty

ConditionalStateOrProvince 參數可篩選用來建立動態通訊群組的信箱使用者或擁有郵件功能的連絡人。如果已指定 RecipientFilter 參數,則無法使用 ConditionalStateOrProvince

以逗點隔開 ConditionalStateOrProvince 的多個值時,會套用 OR 布林運算子。

Confirm

選用

System.Management.Automation.SwitchParameter

Confirm 參數會使得命令暫停處理,並要求確認命令將進行的動作之後才會繼續處理。您不需要為 Confirm 參數指定任何值。

DisplayName

選用

System.String

DisplayName 參數指定 Exchange 管理主控台及 Exchange 全域通訊清單 (GAL) 中之動態通訊群組的名稱。如果未指定 DisplayName 參數,則會將 Name 參數的值用於 DisplayName

DomainController

選用

Microsoft.Exchange.Data.Fqdn

若要指定將此組態變更寫入至 Active Directory 之網域控制站的網域全名 (FQDN),請加入 DomainController 參數。

OrganizationalUnit

選用

Microsoft.Exchange.Configuration.Tasks.OrganizationalUnitIdParameter

OrganizationalUnit 參數使用標準名稱語法來指定要在 Active Directory 中建立動態通訊群組的位置。

RecipientContainer

選用

Microsoft.Exchange.Configuration.Tasks.OrganizationalUnitIdParameter

RecipientContainer 參數會根據收件者在 Active Directory 中的位置,篩選用來建立動態通訊群組的收件者。RecipientContainer 的值可以是組織單位 (OU) 或網域的標準名稱。如果未指定 RecipientContainer 的值,則預設搜尋篩選就是 Active Directory 中之動態通訊群組的位置。此位置是使用 OrganizationalUnit 參數來指定。

TemplateInstance

選用

System.Management.Automation.PSObject

將現有的物件提供給 TemplateInstance 參數時,此命令會使用該物件的組態來建立該物件的副本。

UseRusServer

選用

System.String

note附註:
只有在 Exchange Server 2007 SP2 中才能使用此參數。

UseRusServer 參數會指示此命令,使用通訊清單服務執行所在的指定信箱伺服器來取得並設定信箱及 Active Directory 使用者屬性。

通訊清單服務是 Exchange System Attendant 服務的一個元件。通訊清單服務會在 Active Directory 中建立並維護 Exchange 的特定屬性。您可以使用特定資訊 (如通訊清單成員資格與電子郵件地址),透過通訊清單服務來更新網域中的收件者物件。

WhatIf

選用

System.Management.Automation.SwitchParameter

WhatIf 參數指示命令模擬它將對物件採取的動作。使用 WhatIf 參數,則不需要套用任何變更,就能檢視變更。您不需要為 WhatIf 參數指定任何值。

輸入類型

傳回類型

錯誤

錯誤 描述

 

 

例外狀況

例外狀況 描述

  

 

範例

下列程式碼範例顯示如何使用 New-DynamicDistributionGroup 指令程式。

第一個範例會在 Contoso.com 網域的 [使用者] 容器中建立名為 Marketing Group 的新動態通訊群組。Marketing Group 動態通訊群組包含可在 Contoso.com 網域的任何位置中找到,且其 Department 欄位包含 "Marketing" 或 "Sales" 的所有信箱使用者或擁有郵件功能的連絡人。

第二個範例使用 RecipientFilter 參數,在 Contoso.com 網域的 [使用者] 容器中建立名為 Pacific Northwest 的動態通訊群組。Pacific Northwest 動態通訊群組包含可在 Contoso.com 網域的任何位置中找到,且其 State/Province 欄位包含 "Washington" 或 "Oregon" 的所有信箱使用者。

New-DynamicDistributionGroup -Name "Marketing Group" -Alias "Marketing_Group" -IncludedRecipients "MailboxUsers,MailContacts" -OrganizationalUnit "Contoso.com/Users" -ConditionalDepartment "Marketing","Sales" -RecipientContainer "Contoso.com"
New-DynamicDistributionGroup -Name "Pacific Northwest" -Alias "Pacific_Northwest" -OrganizationalUnit "Contoso.com/Users" -RecipientFilter {((RecipientType -eq 'UserMailbox') -and ((StateOrProvince -eq 'Washington' -or StateOrProvince -eq 'Oregon')))} -RecipientContainer "Contoso.com"