다중값 속성 수정

적용 대상: Exchange Server 2013

A multivalued property is a property that can contain more than one value. For example, the BlockedRecipients property on the RecipientFilterConfig object can accept multiple recipient addresses as in the following examples:

  • john@contoso.com
  • kim@northwindtraders.com
  • david@adatum.com

Because the BlockedRecipients property can accept more than one value, it's called a multivalued property. This topic explains how to use the Exchange Management Shell to add values to and remove values from a multivalued property on an object.

개체에 대한 자세한 내용은 구조적 데이터를 참조하세요. 셸에 대한 자세한 내용은 Exchange 2013에서 PowerShell 사용(Exchange 관리 셸)을 참조하세요.

다중값 속성 수정 및 단일 값만 허용하는 속성 수정

이제 SMTP 주소를 차단된 받는 사람 목록에 추가하는 요청을 받게 되는 경우를 고려해 보겠습니다. 새 SMTP 주소를 추가하기 위해 다음 명령을 실행합니다.

Set-TransportConfig -MaxSendSize 12MB

When you use this command to provide a new value to the MaxSendSize property, the stored value is overwritten. This isn't a problem with properties that accept only one value. However, it becomes a problem with multivalued properties. For example, assume that the BlockedRecipients property on the RecipientFilterConfig object is configured to have the three values that are listed in the previous section. 명령을 Get-RecipientFilterConfig | Format-List BlockedRecipients실행하면 다음이 표시됩니다.

BlockedRecipients : {david@adatum.com, kim@northwindtraders.com, john@contoso.com}

이제 차단된 받는 사람 목록에 새 SMTP 주소를 추가하라는 요청을 받았다고 가정합니다. 다음 명령을 실행하여 새 SMTP 주소를 추가합니다.

Set-RecipientFilterConfig -BlockedRecipients chris@contoso.com

명령을 다시 실행 Get-RecipientFilterConfig | Format-List BlockedRecipients 하면 다음이 표시됩니다.

BlockedRecipients : {chris@contoso.com}

이것은 당신이 기대했던 것이 아닙니다. 차단된 받는 사람의 기존 목록에 새 SMTP 주소를 추가하려고 했지만, 대신 차단된 받는 사람의 기존 목록을 새 SMTP 주소로 덮어씁니다. 이 의도하지 않은 결과는 다중값 속성을 수정하는 것이 단일 값만 허용하는 속성을 수정하는 것과 어떻게 다른지를 예시합니다. 다중값 속성을 수정할 때 값의 전체 목록을 덮어쓰는 대신 값을 추가하거나 제거해야 합니다. 다음 섹션에서는 이 작업을 정확히 수행하는 방법을 보여 있습니다.

다중값 속성을 수정하는 방법

다중값 속성을 수정하는 것은 단일 값 속성을 수정하는 것과 비슷합니다. 속성에 저장된 모든 항목을 대체하지 않고 다중값 속성에 값을 추가하거나 제거할 것인지 셸에 알리기 위해 몇 가지 구문을 추가하면 됩니다. 구문은 cmdlet을 실행할 때 매개 변수의 값으로 속성에서 추가하거나 제거할 값 또는 값과 함께 포함됩니다. 다음 표에서는 다중값 속성을 수정하기 위해 cmdlet의 매개 변수에 추가해야 하는 구문을 보여 줍니다.

다중값 속성 구문

작업 구문
Add one or more values to a multivalued property @{Add="<value1>", "<value2>", "<value3>"}
다중값 속성에서 하나 이상의 값 제거 @{Remove="<value1>", "<value2>", "<value3>"}

다중값 속성 구문 테이블에서 선택하는 구문은 cmdlet의 매개 변수 값으로 지정됩니다. For example, the following command adds multiple values to a multivalued property:

Set-ExampleCmdlet -Parameter @{Add="Red", "Blue", "Green"}

이 구문을 사용하면 지정한 값이 속성에 이미 있는 값 목록에서 추가되거나 제거됩니다. 이 항목의 앞부분에서 BlockedRecipients 예제를 사용하면 이제 다음 명령을 사용하여 이 속성의 나머지 값을 덮어쓰지 않고 추가할 chris@contoso.com 수 있습니다.

Set-RecipientFilterConfig -BlockedRecipients @{Add="chris@contoso.com"}

값 목록에서 제거 david@adatum.com 하려면 다음 명령을 사용합니다.

Set-RecipientFilterConfig -BlockedRecipients @{Remove="david@adatum.com"}

More complex combinations can be used, such as adding or removing values to and from a property at the same time. 이렇게 하려면 및 작업 사이에 Add 세미콜론(;)을 Remove 삽입합니다. 예시:

Set-RecipientFilterConfig -BlockedRecipients @{Add="carter@contoso.com", "sam@northwindtraders.com", "brian@adatum.com"; Remove="john@contoso.com"}

명령을 다시 사용하면 Get-RecipientFilterConfig | Format-List BlockedRecipients John의 주소가 제거되는 동안 카터, 샘 및 브라이언의 이메일 주소가 추가된 것을 볼 수 있습니다.

BlockedRecipients : {brian@adatum.com, sam@northwindtraders.com, carter@contoso.com, chris@contoso.com, kim@northwindtraders.com}