Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

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

2,202 views

Published on

Using PowerShell for Exchange Mangement

Published in: Business, Technology
  • Be the first to comment

  • Be the first to like this

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

  1. 1. Harold Wong Senior Technology Specialist Microsoft Corporation 24 Hours of Exchange Server 2007 (Part 09 of 24): Using PowerShell for Exchange Management
  2. 2. What We Will Cover <ul><li>Exchange Server Management model </li></ul><ul><li>Common management tasks </li></ul><ul><li>Scripting Exchange Server tasks </li></ul>
  3. 3. Helpful Experience <ul><li>Experience with Windows Server ® 2003 </li></ul><ul><li>Experience with Microsoft ® Exchange Server </li></ul><ul><li>Familiarity with scripting </li></ul>Level 200
  4. 4. Agenda <ul><li>Review </li></ul><ul><li>Managing Exchange Server with Windows PowerShell™ </li></ul><ul><li>Windows PowerShell Scripting </li></ul>
  5. 5. Review: Introduction to Windows PowerShell <ul><li>New command line and scripting utility </li></ul><ul><li>Manage all aspects of Exchange Server </li></ul><ul><li>Automate management tasks </li></ul>
  6. 6. Review: Introduction to Windows PowerShell <ul><li>What is the purpose of the pipeline? </li></ul><ul><li>Redirect output to text files </li></ul><ul><li>Use the output of one command as the input for another </li></ul><ul><li>Read input from the keyboard </li></ul><ul><li>Temporarily pause the script </li></ul>
  7. 7. Review: Introduction to Windows PowerShell <ul><li>Which CMDLET retrieves information about </li></ul><ul><li>a user’s Exchange Server mailbox? </li></ul><ul><li>Get-Mailbox </li></ul><ul><li>Read-Mailbox </li></ul><ul><li>Get-User </li></ul><ul><li>Get-Mailuser </li></ul>
  8. 8. Review: Introduction to Windows PowerShell <ul><li>Which CMDLET sorts rows of output from a </li></ul><ul><li>PowerShell command? </li></ul><ul><li>Sort-Objects </li></ul><ul><li>Sort-Object </li></ul><ul><li>Sort-By </li></ul><ul><li>Sort-Row </li></ul>
  9. 9. Review: Introduction to Windows PowerShell <ul><li>What is the default execution policy for the </li></ul><ul><li>Exchange Server Administration Shell? </li></ul><ul><li>Restricted </li></ul><ul><li>RemoteSigned </li></ul><ul><li>Unrestricted </li></ul><ul><li>AllSigned </li></ul>
  10. 10. Review: Introduction to Windows PowerShell <ul><li>What character indicates a user-defined </li></ul><ul><li>variable in Windows PowerShell? </li></ul><ul><li>$ </li></ul><ul><li># </li></ul><ul><li>@ </li></ul><ul><li>% </li></ul>
  11. 11. Review: Introduction to Windows PowerShell <ul><li>Which CMDLET changes the execution </li></ul><ul><li>policy in PowerShell? </li></ul><ul><li>Get-ExecutionPolicy </li></ul><ul><li>Alter-ExecutionPolicy </li></ul><ul><li>Set-ExecutionPolicy </li></ul><ul><li>New-ExecutionPolicy </li></ul>
  12. 12. Agenda <ul><li>Review </li></ul><ul><li>Managing Exchange Server with Windows PowerShell </li></ul><ul><li>Windows PowerShell Scripting </li></ul>
  13. 13. Exchange Server Management Model Monad Engine Exchange cmdlets Configuration Data Access Early-bound objs Windows Forms ADO.Net Monad Data Provider Windows Forms CLI Setup MAPI Registry Active Directory ® Metabase
  14. 14. Programmatic Bulk Changes <ul><li>Results of a task can be used as a parameter to another task </li></ul>Get-user | enable-mailbox <ul><li>Looping can result in bulk creation of objects </li></ul>$users = get-user | foreach ($user in $users) { Enable-mailbox –database: “EXBE01Mailbox Store”}
  15. 15. Whatif <ul><li>get-mailbox | </li></ul><ul><li>where-object {$_.servername -eq “sea-exc-01&quot;} | </li></ul><ul><li>move-mailbox –targetdatabase </li></ul><ul><li>“ sea-exc-01Mailbox Database&quot; -whatif </li></ul>
  16. 16. <ul><li>Using Windows PowerShell to Manage Microsoft ® Exchange Server 2007 </li></ul><ul><ul><li>Manage mailboxes </li></ul></ul><ul><ul><li>Manage distribution groups </li></ul></ul><ul><ul><li>Manage public folders </li></ul></ul>demonstration
  17. 17. Managing Exchange Server with Windows PowerShell <ul><li>Which command will create a new </li></ul><ul><li>distribution group? </li></ul><ul><li>Create-DistributionGroup </li></ul><ul><li>Add-DistributionGroup </li></ul><ul><li>New-DistributionGroup </li></ul><ul><li>New-ExDistributionGroup </li></ul>
  18. 18. Managing Exchange Server with Windows PowerShell <ul><li>Which bulk operations can be performed in </li></ul><ul><li>Windows PowerShell? </li></ul><ul><li>Mail-enable mailboxes </li></ul><ul><li>Set mailbox quotas </li></ul><ul><li>Get mailbox permissions </li></ul><ul><li>All of the above </li></ul>
  19. 19. Managing Exchange Server with Windows PowerShell <ul><li>How do you get information about a public </li></ul><ul><li>folder? </li></ul><ul><li>Read-PublicFolder </li></ul><ul><li>Get-FolderInfo </li></ul><ul><li>Set-PublicFolder </li></ul><ul><li>Get-PublicFolder </li></ul>
  20. 20. Agenda <ul><li>Review </li></ul><ul><li>Managing Exchange Server with Windows PowerShell </li></ul><ul><li>Windows PowerShell Scripting </li></ul>
  21. 21. Formatting Output Sort Objects sort-object name, alias Format Table format-table name, alias Format List format-list name, alias
  22. 22. Reporting in the Shell <ul><li>All managed objects in Exchange Server can be exported to .CSV file </li></ul><ul><li>Task results can be viewed in multiple formats </li></ul><ul><li>Robust test harness for service health, system health, rules </li></ul>.CSV
  23. 23. Community Resources <ul><li>Newsgroup: Microsoft.Public.Windows.PowerShell </li></ul><ul><li>Channel 9 tag: </li></ul><ul><ul><li>http://channel9.msdn.com/tags/Monad </li></ul></ul><ul><li>Team blog: </li></ul><ul><ul><li>http://blogs.msdn.com/PowerShell/ </li></ul></ul><ul><li>OMark van Orsouw’s blog: </li></ul><ul><ul><li>http://mow001.blogspot.com </li></ul></ul><ul><li>Wiki: </li></ul><ul><ul><li>http://channel9.msdn.com/wiki/default.aspx/Channel9.WindowsPowerShellWiki </li></ul></ul><ul><li>Script Center: </li></ul><ul><ul><li>www.microsoft.com/technet/scriptcenter/hubs/msh.mspx </li></ul></ul><ul><li>O’Reilly book – Monad: Introducing the MSH Command Shell and Language </li></ul><ul><ul><li>www.oreilly.com/catalog/msh/ </li></ul></ul><ul><li>Manning Press book by Bruce Payette: PowerShell in Action </li></ul><ul><ul><li>http://manning.com/powershell/ </li></ul></ul><ul><li>Sapien Press book by Don Jones: PowerShell </li></ul><ul><ul><li>www.sapienpress.com/ </li></ul></ul><ul><li>MshAnalyzer tool </li></ul><ul><ul><li>www.karlprosser.com/coder/?cat=8 </li></ul></ul>
  24. 24. <ul><li>Using Windows PowerShell Scripts to Manage Exchange Server </li></ul><ul><ul><li>Use scripts for reporting logons </li></ul></ul><ul><ul><li>Use scripts for mailbox reporting </li></ul></ul><ul><ul><li>Use scripts to create mailboxes </li></ul></ul>demonstration
  25. 25. Windows PowerShell Scripting <ul><li>Which Windows PowerShell command gets </li></ul><ul><li>keyboard input? </li></ul><ul><li>Read-Host </li></ul><ul><li>Read-Input </li></ul><ul><li>Get-Input </li></ul><ul><li>Get-Keyboard </li></ul>
  26. 26. PowerShell Scripting <ul><li>To include a password as part of a script, </li></ul><ul><li>which data type must be used? </li></ul><ul><li>String </li></ul><ul><li>Password </li></ul><ul><li>CryptedString </li></ul><ul><li>SecureString </li></ul>
  27. 27. PowerShell Scripting <ul><li>Which of the following output formats </li></ul><ul><li>can Windows PowerShell produce? </li></ul><ul><li>HTML </li></ul><ul><li>XML </li></ul><ul><li>CSV </li></ul><ul><li>All of the above </li></ul>
  28. 28. Session Summary <ul><li>Manage all aspects of Exchange Server </li></ul><ul><li>Fast, reusable automation </li></ul><ul><li>Flexible reporting </li></ul>
  29. 29. Questions and Answers <ul><li>Submit text questions using the “Ask” button. </li></ul><ul><li>Don’t forget to fill out the survey. </li></ul><ul><li>For upcoming and previously live webcasts: www.microsoft.com/webcasts </li></ul><ul><li>Got webcast content ideas? Contact us at: http://go.microsoft.com/fwlink/?LinkId=41781 </li></ul><ul><li>Today's webcast was presented using Microsoft ® Office Live Meeting. Get a free 14-day trial by visiting: www.microsoft.com/presentlive   </li></ul>

×