20342A_09

30
Microsoft ® Official Course Module 9 Managing Exchange Server 2013 with Exchange Management Shell

description

20342A

Transcript of 20342A_09

Page 1: 20342A_09

Microsoft® Official Course

Module 9

Managing Exchange Server 2013 with Exchange Management Shell

Page 2: 20342A_09

Module Overview

Overview of Windows PowerShell 3.0

Managing Exchange Server Recipients by Using the Exchange Management Shell•Managing Exchange Server 2013 with Exchange Management Shell

Page 3: 20342A_09

Lesson 1: Overview of Windows PowerShell 3.0

What’s New in Windows PowerShell 3.0

What Is Windows PowerShell ISE?

Windows PowerShell Modules

Demonstration: Adding Exchange Management Shell to Windows PowerShell ISE

How Can You Use Windows PowerShell Remotely?•Discussion: Benefits of Using Windows PowerShell to Manage Exchange Server 2013

Page 4: 20342A_09

What’s New in Windows PowerShell 3.0

•More than 260 core cmdlets•Management of all Windows Server roles and features•Windows PowerShell Workflow•Windows PowerShell Web Access•Scheduled Jobs•Enhanced Online Help• ISE IntelliSense•Robust Session Connectivity

Page 5: 20342A_09

What Is Windows PowerShell ISE?

You can use the ISE to run commands and to design, write, test, and debug scripts in a

Windows GUI

Windows PowerShell tabs

Script pane

Console pane Add-in Tools pane

IntelliSensesuggestions

Page 6: 20342A_09

Windows PowerShell Modules

You can extend Windows PowerShell by using modules• Import modules by using the Import-Module cmdlet:

Import-Module Hyper-V

• List loaded modules by running the following command:

Get-Module

• Modules can be of the following types:• Script• Binary

Page 7: 20342A_09

Demonstration: Adding Exchange Management Shell to Windows PowerShell ISE• In this demonstration, you will use the Windows PowerShell ISE to manage Exchange Server 2013

Page 8: 20342A_09

How Can You Use Windows PowerShell Remotely?

• The purpose of Windows PowerShell remoting is to: Connect to a remote computer Run one or more commands on that computer Bring those results back to your computer

• The goals of Windows PowerShell remoting are: Single-seat administration Batch administration Lightweight administration

• The three ways to use Windows PowerShell remoting are: One-to-one remoting One-to-many (or fan-out) remoting Many-to-one (or fan-in) remoting

Local Remote

Run command

Page 9: 20342A_09

Discussion: Benefits of Using Windows PowerShell to Manage Exchange Server 2013• For what tasks might you use Windows PowerShell to manage Exchange Server 2013?• For what tasks would you not use Windows PowerShell to manage Exchange Server 2013?

Page 10: 20342A_09

Lesson 2: Managing Exchange Server Recipients by Using the Exchange Management Shell

Accessing Help in Windows PowerShell

Windows PowerShell Pipelines

Options for Formatting Windows PowerShell Output

Demonstration: Managing Exchange Recipients by Using the Exchange Management Shell

Using Windows PowerShell Variables and Loops

Creating Exchange Management Shell Scripts

Discussion: Managing Exchange Recipients with Exchange Management Shell Scripts•Demonstration: Creating an Exchange Management Shell Script

Page 11: 20342A_09

Accessing Help in Windows PowerShell

• Use Get-Help or the alias help, followed by the cmdlet name, to view Help documentation

• Use Get-Help parameters to adjust the amount of help displayed. The parameters are:• -detailed• -examples • -full• -online

• Use Update-Help to download Help documentation

• Use Get-Command, Show-Command, and Show-ExCommand to discover new cmdlets

Get-Help Get-MailboxDatabase

Get-MailboxDatabase -help

Page 12: 20342A_09

Windows PowerShell Pipelines

Get-ADUser –Filter * | New-Mailbox New-Mailbox cmdlet

New-Mailbox cmdlet

Get-ADUser cmdlet

Get-ADUser cmdlet

• The pipeline connects the output from one cmdlet to the input of another cmdlet

• The combination of the first cmdlet, the pipeline operator (|), and the second cmdlet makes a pipeline

Process

object

Process

object

Pipe

Pipe

Page 13: 20342A_09

Options for Formatting Windows PowerShell Output

Cmdlets for formatting output

Cmdlets for manipulating output

Format-Table(FT)

Format-Table(FT)

Format-Custom

(FC)

Measure-Object

(measure)

Sort-Object (sort)

Select-Object (select)

Where-Object

(where)

Format-Wide(FW)

Page 14: 20342A_09

Demonstration: Managing Exchange Recipients by Using the Exchange Management Shell• In this demonstration, you will use Windows PowerShell to manage Exchange Server recipients

Page 15: 20342A_09

Using Windows PowerShell Variables and Loops

foreach ($user in $group){

write-host $user ” is in “ $group}

if ($Today.DayOfWeek = “Monday”) {

write-host “Today is Monday”}

while ($i -ne 25) {write-host $i “is not 25”}

for ($i=1; $i < 25; $i++) {

write-host $i “is not 25”}

Page 16: 20342A_09

Creating Exchange Management Shell Scripts

• An execution policy restricts script execution• The execution policies are:

• Restricted• AllSigned• RemoteSigned• Unrestricted• Bypass

• Scripts are text files with a .ps1 extension• Scripts contain one or more commands that you want the shell to execute in order• Scripts, when run, require a relative or full path to be specified:

.\Get-MailboxSizes.ps1E:\Labfiles\Mod09\Democode\Get-MailboxSizes.ps1

Page 17: 20342A_09

Discussion: Managing Exchange Recipients with Exchange Management Shell Scripts

•What tasks do you want to you create scripts for?•Are there tasks that cannot be scripted?

Page 18: 20342A_09

Demonstration: Creating an Exchange Management Shell Script

• In this demonstration, you will use a script to create new mailboxes

Page 19: 20342A_09

Lesson 3: Managing Exchange Server 2013 with Exchange Management Shell

Overview of Exchange Management Shell Cmdlets

Demonstration: Managing Server Configuration by Using Exchange Management Shell

Overview of Exchange Server 2013 Test Cmdlets

What Are Windows PowerShell Jobs?

Introduction to Windows PowerShell Workflows

Demonstration: Managing Exchange Servers by Using Scheduled Jobs and Workflows•Monitoring Exchange Servers by Using the Exchange Management Shell

Page 20: 20342A_09

Overview of Exchange Management Shell Cmdlets

Common Verbs Examples

Get Get-AddressListGet-Queue

Set Set-AddressListSet-AcceptedDomain

New New-AcceptedDomainNew-MailboxNew-MailboxDatabase

Add Add-AdPermissionAdd-IPAllowListEntry

Test Test-ExchangeSearchTest-ReplicationHealth

Remove Remove-AcceptedDomainRemove-AddressList

Page 21: 20342A_09

Demonstration: Managing Server Configuration by Using Exchange Management Shell• In this demonstration, you will see common management tasks performed by using the Exchange Management Shell

Page 22: 20342A_09

Overview of Exchange Server 2013 Test Cmdlets

•Test cmdlets use the Test verb•There are 35 Test cmdlets available for Exchange Server 2013•Can be used to manually test health•Can be used by monitoring software or scripts to automatically test health

Page 23: 20342A_09

What Are Windows PowerShell Jobs?

Background Jobs:• Performs extended tasks in the background• Performs tasks on multiple remote servers

Scheduled Jobs:• Runs registered background jobs on a schedule• Uses triggers to define a schedule

Page 24: 20342A_09

Introduction to Windows PowerShell Workflows

• You can use Windows PowerShell Workflow to:• Automate long-running and complex activities• Automate multiple server management and application provisioning• Resume, pause, and restart processes

• To create workflows, use Windows PowerShell or Visual Studio Workflow Designer

Page 25: 20342A_09

Demonstration: Managing Exchange Servers by Using Scheduled Jobs and Workflows• In this demonstration, you will use Windows PowerShell jobs to manage Exchange servers

Page 26: 20342A_09

Monitoring Exchange Servers by Using the Exchange Management Shell

•Get-Queue Returns information about the transport queues such as:• LastError• Status• LastRetryTime• NextRetryTime• MessageCount• DeliveryType

•Get-EventLog Returns events from the event log

Page 27: 20342A_09

Lab: Managing Exchange Server 2013 by Using Exchange Management Shell

Exercise 1: Exploring the Exchange Management Shell• Exercise 2: Using Exchange Management Shell to Manage Recipients

Logon Information

Virtual machines20342A-LON-DC120342A-LON-CAS120342A-LON-MBX1

User Name Adatum\AdministratorPassword Pa$$w0rd

Estimated Time: 60 minutes

Page 28: 20342A_09

Lab Scenario

As the A. Datum organization grows in size and complexity, it is becoming increasingly apparent that some of the IT management processes need to be streamlined. This requirement includes managing the Exchange Server deployment. As A. Datum adds new branch offices and acquires other companies, it is important that recipient management is quick and efficient. Also, the server management tasks need to be more consistent and efficient. 

To address these management issues, you need to be familiar with the Exchange Management Shell and how to use it to manage the Exchange Server organization. You need to understand how to run simple and complex commands and how to create scripts that automate many of the regular management tasks.

Page 29: 20342A_09

Lab Review

What happens if you try to run an Exchange Server cmdlet and do not have the Exchange Management Shell module imported?•Why do you need to specify the DeletedItemRetention property for the Format-Table cmdlet?

Page 30: 20342A_09

Module Review and Takeaways

Review Questions

Tools

Best Practice•Common Issues and Troubleshooting Tips