O'Reilly logo

Microsoft Exchange Server PowerShell Cookbook - Third 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

This searches all e-mail items

Kind:meetings

This searches all meeting items

Kind:tasks

This searches all task items

Kind:notes

This searches all note items

Kind:docs

This searches all doc items

Kind:journals

This searches all journal items

Kind:contacts

This searches all contact items

Kind:im

This searches all im items

Examples

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

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

If you want to delete ...

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