24 Hours Of Exchange Server 2007 (Part 8 Of 24)

33
24 Hours of Exchange Server 24 Hours of Exchange Server 2007 (Part 8 of 24): 2007 (Part 8 of 24): Introduction to Windows Introduction to Windows Powershell Powershell Harold Wong [email protected] om blogs.technet.com/ haroldwong udio, please try Streaming Internet Audio first at doesn’t work, use: (800) 229-0449, Pin 9634

description

Introduction to PowerShell

Transcript of 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Page 1: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

24 Hours of Exchange Server 2007 24 Hours of Exchange Server 2007 (Part 8 of 24): Introduction to (Part 8 of 24): Introduction to Windows PowershellWindows Powershell

Harold [email protected]/haroldwong

For audio, please try Streaming Internet Audio firstIf that doesn’t work, use: (800) 229-0449, Pin 9634

Page 2: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

What We Will CoverWhat We Will Cover

• Introducing Windows PowerShell™Introducing Windows PowerShell™

• Using Windows PowerShellUsing Windows PowerShell

• Creating Windows PowerShell scriptsCreating Windows PowerShell scripts

Page 3: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

AgendaAgenda

• ReviewReview

• Introducing Windows PowerShellIntroducing Windows PowerShell

• Scripting with Windows PowerShellScripting with Windows PowerShell

Page 4: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Review: Configuring Exchange Review: Configuring Exchange ServerServer

• Databases and storage groups conceptsDatabases and storage groups concepts

• Public Folder overview and replicationPublic Folder overview and replication

• Folder and group Windows PowerShell Folder and group Windows PowerShell CmdletsCmdlets

Page 5: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Review: Implementing the Review: Implementing the Mailbox ServerMailbox Server

1.1. Mailbox server roleMailbox server role

2.2. Client Access server roleClient Access server role

3.3. Edge Transport server roleEdge Transport server role

4.4. Unified Messaging server roleUnified Messaging server role

Which server role must be installed on its own computer, without any other ExchangeServer role?

Page 6: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Review: Implementing the Review: Implementing the Mailbox ServerMailbox Server

1.1. Mailbox server roleMailbox server role

2.2. Client Access server roleClient Access server role

3.3. Hub Transport server roleHub Transport server role

4.4. Unified Messaging server roleUnified Messaging server role

Which server role is optional, and may be left out of an Exchange Server 2007deployment if desired?

Page 7: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Review: Implementing the Review: Implementing the Mailbox ServerMailbox Server

1.1. Mailbox server roleMailbox server role

2.2. Client Access server roleClient Access server role

3.3. Edge Transport server roleEdge Transport server role

4.4. Unified Messaging server roleUnified Messaging server role

Microsoft® Office Outlook® 2007 clientsinside your firewall typically access whichServer to send and receive email?

Page 8: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Review: Public Folder OverviewReview: Public Folder Overview

1.1. Offline address book distributionOffline address book distribution

2.2. Free/busy lookupsFree/busy lookups

3.3. RSS feedsRSS feeds

4.4. Outlook 2007 security settingsOutlook 2007 security settings

Which of these built-in Outlook 2007applications can not use public folders?

Page 9: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Review: Public Folder OverviewReview: Public Folder Overview

1.1. Mailbox serverMailbox server

2.2. Edge Transport server Edge Transport server

3.3. Hub Transport server Hub Transport server

4.4. Unified Messaging server Unified Messaging server

Which server role hosts public folders in Exchange Server 2007?

Page 10: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Review: Public Folder OverviewReview: Public Folder Overview

1.1. Upgrade to Outlook 2007Upgrade to Outlook 2007

2.2. Migrate public folders to form librariesMigrate public folders to form libraries

3.3. Share data with SharePoint ServicesShare data with SharePoint Services

4.4. Develop new applications with the Develop new applications with the MicrosoftMicrosoft®® .NET Framework .NET Framework

As public folders become de-emphasized by Microsoft, which is not a recommended strategy to manage this change?

Page 11: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Review: Configure and Manage Review: Configure and Manage Public FoldersPublic Folders

1.1. New-PublicFolderDatabaseNew-PublicFolderDatabase

2.2. Set-PublicFolderSet-PublicFolder

3.3. Get-PublicFolderGet-PublicFolder

4.4. None of the aboveNone of the above

Which of following cmdlets can be invoked bythe Exchange Management Console?

Page 12: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Review: Configure and Manage Review: Configure and Manage Public FoldersPublic Folders

1.1. New-PublicFolderNew-PublicFolder

2.2. Set-PublicFolderSet-PublicFolder

3.3. Get-PublicFolderGet-PublicFolder

4.4. Update-PublicFolderUpdate-PublicFolder

Which cmdlet is used to manage public folder replicas?

Page 13: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Review: Configure and Manage Review: Configure and Manage Public FoldersPublic Folders

1.1. *.vbs*.vbs

2.2. *.ps1*.ps1

3.3. *.msh*.msh

4.4. None of the aboveNone of the above

Which of the following script types can you run by default from the Exchange Management Shell?

Page 14: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

AgendaAgenda

• ReviewReview

• Introducing Windows PowerShellIntroducing Windows PowerShell

• Scripting with Windows PowerShellScripting with Windows PowerShell

Page 15: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Windows PowerShell OverviewWindows PowerShell Overview

Command-line Command-line interfaceinterface

Exchange Exchange Server Server snap-insnap-in

Task Task automationautomation

Bulk Bulk operationsoperations

Extends Extends consoleconsole

Page 16: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Windows PowerShell FeaturesWindows PowerShell Features

• Object-oriented data handlingObject-oriented data handling

• NamespacesNamespaces

• PipeliningPipelining

• Access to CMD commandsAccess to CMD commands

• Trusted scriptsTrusted scripts

Page 17: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Why Use Windows PowerShell?Why Use Windows PowerShell?

One-linersOne-liners

Raw modeRaw mode

What if?What if?

InteractiveInteractive

Page 18: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Name Alias Server StorageQuota---- ---- ------ ------------Bob Kelly bobk smbex01 unlimitedKim Akers kima smbex01 unlimited

MSH> get-mailbox –server “smbex01”

Verb NounName

ArgumentString

Command Parameter

Windows PowerShell SyntaxWindows PowerShell Syntax

Property Names

Property Values

Page 19: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Introducing Windows PowerShell

Use basic Windows PowerShell commandsUse basic Windows PowerShell commands Format outputFormat output

demonstrationdemonstration

Page 20: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Review: Introducing Windows Review: Introducing Windows PowershellPowershell

1.1. Redirect output to text filesRedirect output to text files

2.2. Use the output of one command as the input Use the output of one command as the input for anotherfor another

3.3. Read input from the keyboardRead input from the keyboard

4.4. Temporarily pause the scriptTemporarily pause the script

Q1: What is the purpose of the pipeline?

Page 21: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Review: Introducing Windows Review: Introducing Windows PowershellPowershell

1.1. Get-MailboxGet-Mailbox

2.2. Read-MailboxRead-Mailbox

3.3. Get-UserGet-User

4.4. Get-MailuserGet-Mailuser

Q2: Which CMDLET retrieves information about auser’s Exchange Server mailbox?

Page 22: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Review: Introducing Windows Review: Introducing Windows PowershellPowershell

1.1. Sort-ObjectsSort-Objects

2.2. Sort-ObjectSort-Object

3.3. Sort-BySort-By

4.4. Sort-RowSort-Row

Q3: Which CMDLET sorts rows of output from aWindows PowerShell command?

Page 23: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

AgendaAgenda

• ReviewReview

• Introducing Windows PowerShellIntroducing Windows PowerShell

• Scripting with Windows PowerShellScripting with Windows PowerShell

Page 24: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Reduced ComplexityReduced Complexity

Page 25: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Automating ManagementAutomating Management

• Join multiple tasks togetherJoin multiple tasks together

• Tasks and scripts can be called Tasks and scripts can be called from managed codefrom managed code

• Sample scripts available through Sample scripts available through community sitescommunity sites

• Scripts can be reusedScripts can be reused

Page 26: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Performing Exchange Server Administration

Move mailboxesMove mailboxes Create a mail storeCreate a mail store Create a Windows PowerShell scriptCreate a Windows PowerShell script

demonstrationdemonstration

Page 27: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Secure Scripting EnvironmentSecure Scripting Environment

Default is Default is RemoteSignedRemoteSigned

Must call Must call with full pathwith full path

Cannot Cannot automatically automatically

run scriptsrun scripts

Four levels Four levels of securityof security

Page 28: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Review: Scripting with Windows Review: Scripting with Windows PowershellPowershell

1.1. RestrictedRestricted

2.2. RemoteSignedRemoteSigned

3.3. UnrestrictedUnrestricted

4.4. AllSignedAllSigned

Q1: What is the default execution policy for theWindows PowerShell?

Page 29: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Review: Scripting with Windows Review: Scripting with Windows PowershellPowershell

1.1. $$

2.2. ##

3.3. @@

4.4. %%

Q2: What character indicates a user-defined variableIn Windows PowerShell?

Page 30: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Review: Scripting with Windows Review: Scripting with Windows PowershellPowershell

1.1. Get-ExecutionPolicyGet-ExecutionPolicy

2.2. Alter-ExecutionPolicyAlter-ExecutionPolicy

3.3. Set-ExecutionPolicySet-ExecutionPolicy

4.4. New-ExecutionPolicyNew-ExecutionPolicy

Q3: Which CMDLET changes the execution policy inWindows PowerShell?

Page 31: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Session SummarySession Summary

• New command line and scripting utilityNew command line and scripting utility

• Manage all aspects of Exchange ServerManage all aspects of Exchange Server

• Automate management tasksAutomate management tasks

Page 32: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)

Questions and AnswersQuestions and Answers

• Submit text questions using the “Ask” button. Submit text questions using the “Ask” button. • Don’t forget to fill out the survey.Don’t forget to fill out the survey.• For upcoming and previously live webcasts: For upcoming and previously live webcasts:

www.microsoft.com/webcasts

• Got webcast content ideas? Contact us at: Got webcast content ideas? Contact us at: http://go.microsoft.com/fwlink/?LinkId=41781

• Today's webcast was presented using MicrosoftToday's webcast was presented using Microsoft®® Office Live Meeting. Get a free 14-day trial by Office Live Meeting. Get a free 14-day trial by visiting: visiting: www.microsoft.com/presentlive  

Page 33: 24 Hours Of Exchange Server 2007 (Part 8 Of 24)