관리 메뉴

MY IT Life

Exchange Management Shell을 이용한 사서함 메일 삭제 본문

02. Microsoft/Exchange 2016

Exchange Management Shell을 이용한 사서함 메일 삭제

검짱돌이 2019. 5. 30. 13:49

Exchange Management Shell을 이용한 불특정 사용자에 대한 제목 기준 메일 삭제 방법을 공유 합니다.

Today I share you what remove unspecified emil date in user mailbox.Share the subject-based mail deletion method for unspecified users using the Exchange Management Shell.

 

1. Export된 사용자 중 메일을 제거할 사용자만 sort합니다.

    Soft unspecified user infomation in CSV

2. A열에 Seach-mailbox B열에 사용자 주소 C열에 -SearchQuery '주제:"국세청송장"' -DeleteContent -Force 입력 후 D열에      Concatenate명령으로 구문을 완성 후 D열을 복사하여 새시트에 숫자형식으로 복사합니다.  

   Seach-mailbox in Column A, User Address in Column B,-SearchQuery 'Topic: "IRS Invoice"' -DeleteContent -Force in Column C After completing the syntax with the Concatenate command in Column D, copy Column D into a new sheet in numeric format.

Copy column D line copy and paste next sheet

3. A열의 명령어를 복사해서 Exchange Management Shell에 붙여줍니다.

   Copy command in column A and paste in Exchange Manangement Shell

만약  위 사항이 불편하면

If you have too many customer info do it below

 

$Export = Get-Content user.csv

 

foreach ($i in($export)) {search-mailbox $i -SearchQuery 'Received=06/21/2019..06/22/2019 AND 주제:d' -DeleteContent -force}