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

Working with contacts


Once you've started managing mailboxes using the Exchange Management Shell, you'll probably notice that the concepts and command syntax used to manage contacts are very similar. The difference of course is that we need to use an different set of cmdlets. In addition, we also have two types of contacts to deal with in Exchange. We'll take a look at how you can manage both of them in this recipe.

How to do it...

  1. To create a mail-enabled contact, use the New-MailContact cmdlet:

    New-MailContact -Alias rjones `
    -Name "Rob Jones" `
    -ExternalEmailAddress [email protected] `
    -OrganizationalUnit sales
  2. Mail-enabled users can be created with the New-MailUser cmdlet:

    New-MailUser -Name 'John Davis' `
    -Alias jdavis `
    -UserPrincipalName [email protected] `
    -FirstName John `
    -LastName Davis `
    -Password (ConvertTo-SecureString -AsPlainText P@ssw0rd -Force) `
    -ResetPasswordOnNextLogon $false `
    -ExternalEmailAddress [email protected]

How it works...

Mail contacts are useful when you have...