Skip to main content

SEARCH MAILBOX IN EXCHANGE SERVER

 

https://www.stellarinfo.com/blog/use-search-mailbox-export-to-pst-in-exchange-server/

An Exchange database can be a storehouse of thousands of user mailboxes. Often, situations arise that demand database administrators (DBAs) to perform various operations on these mailboxes, such as exporting them to a PST format. It may be required to create a backup of the mailbox or migrate the mailbox to another server or Outlook account. Further, DBAs might require to export mailbox to PST in a complex situation such as following,

“When setting up email forwarding, an error in the settings resulted in the sender’s mailbox not having any copy of the forwarded emails. To rectify this mistake, the user wanted to receive back all the mails sent out during the forward.”

In a situation like this, DBAs require to perform search operations on the mailbox of the user where the mails were forwarded to. After finding the required mailbox, PST can be exported and then imported to the sender’s mailbox. This way, the mails can be retrieved. The PowerShell command that is used for the purpose is Search-Mailbox.

NOTE: Although you can search and export mailboxes to PST via Mailbox Import Export cmdlets, it often involves risk factors like data loss. That’s the reason a majority of DBAs prefer Stellar Converter for EDB to find and export Exchange mailboxes to Outlook PST format easily and efficiently.

PowerShell “Search-Mailbox” Command

The PowerShell Search-Mailbox command is available in both on-premise and cloud Exchange. However, some parameters and settings could be different. This cmdlet is used to search messages in a specified mailbox and thereafter to perform any of the following tasks:

  • Copy the searched messages to a specified target mailbox
  • Delete searched messages from the source mailbox (For this, you have to be assigned the “Mailbox Import Export Management Role”)
  • Perform single item recovery to recover items from a user’s ‘Recoverable Items’ folder
  • Clean up the ‘Recoverable Items’ folder for a mailbox when it has reached the hard quota

So, if an Exchange DBA faces the need to export a specific user mailbox or mail items from EDB file into another format like PST, the Search-Mailbox cmdlet is a feasible way to do it.

How to Use Search-Mailbox Cmdlet to Export to PST?

To use the Search-Mailbox cmdlet, the user must be assigned with Mailbox Search or Mailbox Import Export roles. By default, these roles aren’t assigned to any user, including administrators. Thus, to use the Search-Mailbox cmdlet, assign any of these roles to the user account. However, if you want to delete the searched mailbox items, save them to the target mailbox, or export them to PST, assign both roles.

The syntax of the Search-Mailbox cmdlet is:

Search-Mailbox [-Identity] [-EstimateResultOnly] [-Confirm] [-DomainController <Fqdn>] [-DoNotIncludeArchive] [-Force] [-IncludeUnsearchableItems] [-SearchDumpster] [-SearchDumpsterOnly] [-SearchQuery <String>] [-WhatIf] [<CommonParameters>]

For a better understanding of how to use Search-Mailbox to find and export mailbox items to PST, here’s an example of the cmdlet in action:

Search-Mailbox -Identity “John Doe” -SearchQuery “Subject: Project Hamilton” -TargetMailbox “DiscoveryMailbox” -TargetFolder “JohnDoe-ProjectHamilton” -LogLevel Full

Once the mails are saved in the target mailbox, you can export the saved emails from the target mailbox to PST via the New-MailboxExportRequest cmdlet.

However, to use the cmdlet, you must know the source and target mailbox. Also, the network path to save the exported PST.

NOTE: You can’t export PST by using Search-Mailbox cmdlet. You must use the New-MailboxExportRequest cmdlet to create PST export request, post saving the searched mail items in the target mailbox.

TIP: với nhiều mailbox => tạo 1 Distribution Group tạm, add các mailbox cần search vào group này, run CLI như sau:

Get-DistributionGroupMember "7804-audit-group" | search-mailbox -SearchQuery '7804 OR golden' -TargetMailbox "7804-audit" -TargetFolder "Audit" -LogLevel full

Limitations of using Search-Mailbox Cmdlet

While the usage of Search-Mailbox to find specific mail items and export them to PST looks fairly simple, the entire approach suffers from a few limitations,

  • You need to be assigned specific permissions and roles to execute the cmdlet
  • Improper usage of the cmdlet may lead to unexpected data loss
  • The command is a bit too technical for users who don’t have prior experience in working with command line procedures as complex as this one or who aren’t fully aware of the parameters that are to be used along with the cmdlet

To overcome these limitations, Exchange experts recommend using a much efficient technique to export EDB content to PST format. This technique involves the use of reliable and advanced EDB to PST Converter software to convert mailbox contents saved within the EDB file into Outlook importable PST format.

The Safest Alternative to Search-Mailbox cmdlet

Stellar Converter for EDB is the most viable method of accomplishing safe and accurate EDB to PST conversion in Exchange. The tool proficiently converts online (Hosted) as well as offline EDB files into Outlook PST files without hampering with mailbox format or structure. It converts the mailboxes to PST with 100% integrity and precision. Besides, it also recovers deleted mailboxes from the database file.

A few prominent features of the software include,

  • It extracts single or multiple mailboxes as per user need
  • Recovers accidentally deleted mailboxes
  • Exports offline EDB file to Live Exchange Server or Office 365 accounts
  • Options to save converted mailbox items, such as emails in a variety of formats like EML, MSG, RTF, PDF, & HTML

In addition to these advanced features, the software comes laced with an interactive and intuitive GUI, which makes its operation extremely easy. Plus, it doesn’t require any additional permissions or roles and lets you directly search and export specific mail items to PST. Also, you can download the free demo version to scan, preview, and search converted mailboxes before saving to PST.

Comments

Popular posts from this blog

[RAID] SWITCH FROM AHCI TO RAID WITH INTEL C600 CONTROLLER

I personally have used other ways to do this. Manipulating some registry settings in combination with a safe boot before booting normally does the trick as well. This works with both SATA SSD and M.2 NVMe drives and it enables relatively fast switching between back and forth between AHCI and RAID. I have described this method below.  I have also tried the same process used to switch from RAD to AHCI and that works as well. Switch to safe boot Reboot into BIOS Change from AHCI to RAID in the BIOS Boot into safe mode Turn off safe mode and reboot normally again Nothing else and that also did the trick, just like with moving from RAID to AHCI.  So the link above and my step by step below is here for completeness. You have options in case one of them doesn’t work! Step by step AHCI to RAID registry method This procedure I describe below works on Windows 10 1803/1809 and has been tested on Dell Latitude E6220 an XPS 13 9360. Editing the registry is...

[Hyper-V] - Lỗi không boot vào được sau khi convert máy vật lý sang máy ảo

XỬ LÝ LỖI KHÔNG BOOT ĐƯỢC VÀO MÁY ẢO SAU KHI CONVERT TỪ MÁY VẬT LÝ BẰNG DISK2VHD Sau khi convert server vật lý sang file VHD để import vào Hyper thì khi start máy ảo lên màn hình máy ảo chỉ nhấp nháy con trỏ chuột trên màn hình đen (blinking cursor) NGUYÊN NHÂN Do máy vật lý sử dụng ổ đĩa cài OS được format theo chuẩn GPT (thay vì MBR như truyền thống, tham khảo GPT và MBR ) XỬ LÝ Bước 1: chuyển ổ GPT thành MBR Copy file VHD của ổ đĩa chứa OS về 1 máy tính Windows 8 trở lên Trên máy Windows 8+ click phải chuột lên file VHD vừa copy, chọn lệnh Mount . Lúc này dùng 1 phần mềm miễn phí (vd: Mini Partition Wizard ) để convert ổ đĩa vừa mount từ GPT  -> MBR Sau đó Delete phần Partition dư ra ở phần đầu ổ đĩa được mount (khoảng vài trăm MB) Set " Active " cho ổ đĩa này để là ổ đĩa boot OS Nhấn Apply để phần mềm thực thi tác vụ Sau khi phần mềm làm xong, tắt phần mềm Mini Partition Wizard, vào My Computer chọn eject ổ đĩa đang mount . Copy file VHD vừa đư...

LỖI "The provided partition "Migration...." is not a valid Migration mailbox"

  Solution for a valid Migration mailbox could not be found for this organization To address this issue, we will: Delete Migration mailbox in Active Directory Users and Computers Recreate Migration mailbox with /PrepareAD command Enable Migration mailbox with Exchange Management Shell 1. Delete Migration mailbox in Active Directory Users and Computers We do see the mailbox in ADUC, let’s remove it. If you don’t see it, search for it. It might be in a different container than the default container  Users . We can always verify in Exchange Management Shell if the Migration mailbox is present. If it shows up in the output, it means that it’s present and enabled. The output should be empty. [PS] C:\> Set - ADServerSettings - ViewEntireForest $true ; Get - Mailbox - Identity "Migration.8f3e7716-2011-43e4-96b1-aba62d229136" - Arbitration | Format-Table Name , ServerName , Database , AdminDisplayVersion , ProhibitSendQuota Copy 2. Recreate Migration mailbox with /Prepare...