O'Reilly logo

Microsoft Exchange Server 2013 PowerShell Cookbook - Second Edition by Mike Pfeiffer, Jonas Andersson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the message type search

The following table outlines the properties that can be used to define an AQS query using a message type restriction:

Property

Example

Description

Kind

Kind:email

Kind:meetings

Kind:tasks

Kind:notes

Kind:docs

Kind:journals

Kind:contacts

Kind:im

Searches all email items

Searches all meeting items

Searches all task items

Searches all note items

Searches all doc items

Searches all journal items

Searches all contact items

Searches all im items

Examples

If you want to delete all the contacts from a mailbox, use the following code:

Search-Mailbox -Identity administrator `
-SearchQuery "Kind:Contacts" `
-DeleteContent `
-Force

If you want to delete all the notes from a mailbox, use the following code:

Search-Mailbox ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required