Book Image

Microsoft Exchange 2010 PowerShell Cookbook

Book Image

Microsoft Exchange 2010 PowerShell Cookbook

Overview of this book

Table of Contents (22 chapters)
Microsoft Exchange 2010 PowerShell Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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 contacts from a mailbox, use the following code:

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

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

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