create shared mailbox using PowerShell

 

1.      Run below command in office 365 PowerShell to create shared mailbox.

 

Set-Mailbox –identity ‘username@xyz.com’ -Type shared

 

2.      Run below command in office 365 PowerShell to assign audit log age.

 

Set-Mailbox -identity username@xyz.com -AuditEnabled $true -AuditLogAgeLimit 180

Extract mailbox as PST

 

Steps to extract copy of emails from the mailbox.

·       Head over to https://purview.microsoft.com/ediscovery

·       Click Ediscovery => Content Search and click the plus icon to create a “Create a Search”.

·       Give the search a name and a description if desired and click “Create

 

·       Under the Source section select “Add source”.

 

·       specify the mailboxes to search. Use the search box to find user mailboxes.


·       Once required user is selected, click “Manage”.

 


 

·       Only select “Mailboxes” section and click “save”.


 

·       Review the search settings (and edit if necessary), and then click “Run Query” to start the search.

·       Select Process Manager -> wait for search completion.


A screenshot of a computer

AI-generated content may be incorrect.

 

 

·       Once search got completed -> click on Export Results.


·       Enter export name

·       Select “Index items that match your search query and partially indexed items

·       Select “Perform advanced indexing on partially indexed items

 

A screenshot of a export page

AI-generated content may be incorrect.

 

·       Deselect “Include Teams and Viva Engage conversations”.

·       Deselect “Organize conversations into HTML transcript

·       Deselect “Access links (cloud attachments) in messages

 

A screenshot of a screen

AI-generated content may be incorrect.

 

·       Click “Export”

 

·       Goto -> Exports Tab-> Select your export.


 

·       Once Export has completed start downloading the results


·       Click on Download.

·       Wait for Download to finish.


Steps to Open PST file into Outlook

 

·       Open Outlook, goto “File” section, Click “Open and Export”, then click “Open Outlook Data File

Upload PST emails to Mailbox

 

1.     Download the PST file from the mentioned link. (Keep the PST in user One Drive for future safe keeping)

2.     Open Outlook.

3.     Choose the File tab in the ribbon.

4.     Choose “Open & Export”

5.     Click on “Import/Export”

1.     Select “Import from another program or file”.

2.     Click Next.

3.     Select "Outlook Data File(.pst)” option.

4.     Click next.

5.     Browse to PST file location and select the file.

6.     Click next.

Restore emails from soft deleted mailbox

 

1.      Run this command to get the necessary information about the mailbox:

Get-Mailbox -InactiveMailboxOnly | FL Name,DistinguishedName,ExchangeGuid,PrimarySmtpAddress

 

2.      Run this command to store the mailbox to a variable.  (Identity here is the ExchangeGUID for Adam Platt and was gathered from running the previous command)

 

$InactiveMailbox = Get-Mailbox -InactiveMailboxOnly -Identity 12341111-8d44-46fe-a41c-55234234

 

3.      Run this command to restore the contents of the inactive mailbox to an existing mailbox, while specifying a top-level folder in the target mailbox in which to restore the contents from the inactive mailbox. If the specified target folder or target folder structure doesn't already exist in the target mailbox, it is created during the restore process. 

New-MailboxRestoreRequest -SourceMailbox $InactiveMailbox.DistinguishedName -TargetMailbox user@xyz.com -TargetRootFolder "user's Inbox" -AllowLegacyDNMismatch

 

4.      Restore the contents of the archive from the inactive mailbox to the archive of an existing mailbox, while specifying a specific folder:

New-MailboxRestoreRequest -SourceMailbox $InactiveMailbox.DistinguishedName -SourceIsArchive -TargetMailbox user@xyz.com -TargetIsArchive -TargetRootFolder "user’s Archive" -AllowLegacyDNM

                                                OR

Restore the contents of the archive from the inactive mailbox to existing mailbox inbox folder, while specifying a specific folder:

 

New-MailboxRestoreRequest -SourceMailbox $InactiveMailbox.DistinguishedName -SourceIsArchive -TargetMailbox user@xyz.com -TargetRootFolder "user’s Archive" -AllowLegacyDNMismatch

 

Outlook Search Issue - No Results Found

 

Step 1: Check Outlook Search Settings

  1. Open Outlook.
  2. Go to File > Options > Search.
  3. Click Indexing Options….
  4. Ensure Microsoft Outlook is listed under Included Locations. If not, click Modify and check it.
  5. Click Advanced, then under the Index Settings tab, click Rebuild to recreate the search index. This may take time depending on mailbox size.

If “Indexing Options…” is Grayed Out

  1. Press Windows + R, type services.msc, and press Enter.
  2. Locate Windows Search in the list.
  3. If it's Stopped, right-click and select Start.
  4. If it's Disabled:
    • Right-click > Properties.
    • Set Startup type to Automatic.
    • Click OK, then Start the service.

Step 2: Ensure Windows Search Feature is Enabled

 

  1. Open Control Panel > Programs and Features.
  2. Click Turn Windows features on or off (left pane).
  3. Ensure Windows Search is checked. If not, check it and click OK.
  4. Restart your PC if prompted.

Step 3: Additional Fixes (if issue persists)

 

  • Check File Indexing Permissions:
    • Navigate to your OST/PST file location (usually under C:\Users\<username>\AppData\Local\Microsoft\Outlook).
    • Right-click the file > Properties > Advanced.
    • Ensure "Allow this file to have contents indexed..." is checked.

 

  • Run the Windows Search Troubleshooter:
    • Go to Settings > System > Troubleshoot > Other troubleshooters.
    • Run the Search and Indexing troubleshooter.

 

  • Repair Outlook Data Files:
    • Run scanpst.exe (Inbox Repair Tool) to fix corrupted PST/OST files.

 

  • Create a New Outlook Profile:
    • Go to Control Panel > Mail > Show Profiles > Add.
    • Set up a new profile and test search functionality.