Presentation is loading. Please wait.

Presentation is loading. Please wait.

The top ten PowerShell commands for Exchange

Similar presentations


Presentation on theme: "The top ten PowerShell commands for Exchange"— Presentation transcript:

1 The top ten PowerShell commands for Exchange
5/23/2018 7:15 AM THR2088 The top ten PowerShell commands for Exchange Steve Goodman Content and Code MVP, Office Servers & Services @SteveGoodman | © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

2 The top ten PowerShell commands for Exchange
These are commands I couldn’t do without Don’t worry - the top command is not Get-Mailbox Hopefully some of the of the commands might surprise you…. And there’s a LOT to choose from…

3 5/23/2018 7:15 AM 10 © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

4 Get-Help Every Exchange admin needs a little help sometimes, right?
5/23/2018 7:15 AM Get-Help Every Exchange admin needs a little help sometimes, right? © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

5 Using Get-Help Get-Help New-Transportrule –Examples
Get-Help New-OWAVirtualDirectory -Online © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

6 9 5/23/2018 7:15 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

7 Get-Content Examine your log files. Watch them in real-time
© Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

8 Using Get-Content Get-Content (file) –Tail 1 –Wait
5/23/2018 7:15 AM Using Get-Content Get-Content (file) –Tail 1 –Wait $File = Get-Content (file) $File[1] © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

9 8 5/23/2018 7:15 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

10 Select-Object Pick what you need, nothing else 5/23/2018 7:15 AM
© Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

11 5/23/2018 7:15 AM Using Select-Object Get-Mailbox | Select DisplayName, SamAccountName, UserPrincipalName, PrimarySMTPAddress Get-MailboxStatistics –Database (DB) | Select DisplayName,TotalItemSize © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

12 7 5/23/2018 7:15 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

13 5/23/2018 7:15 AM Start-Transcript What was it I did to my Exchange Server the other day? © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

14 Using Start-Transcript and Stop-Transcript
5/23/2018 7:15 AM Using Start-Transcript and Stop-Transcript Start-Transcript # Do all sorts of damage, but it’s OK because you had a change request approved Stop-Transcript © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

15 6 5/23/2018 7:15 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

16 Test-NetConnection Still using Telnet to check ports are open?
5/23/2018 7:15 AM Test-NetConnection Still using Telnet to check ports are open? © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

17 Using Test-NetConnection
5/23/2018 7:15 AM Using Test-NetConnection Test-NetConnection outlook.office365.com –Port 25 Test-NetConnection outlook.office365.com -Traceroute © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

18 5 5/23/2018 7:15 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

19 5/23/2018 7:15 AM Export-CliXML Keep your Exchange command output for later and play it again later! © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

20 Using Import-CliXML and Export-CliXML
5/23/2018 7:15 AM Using Import-CliXML and Export-CliXML Get-Mailbox –ResultSize Unlimited | Export-CliXML .\Mailboxes.XML # Copy it somewhere else Import-CliXML .\Mailboxes.XML © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

21 4 5/23/2018 7:15 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

22 5/23/2018 7:15 AM Out-Gridview View and manipulate your Exchange information from the command prompt – in a GUI! © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

23 Using Out-GridView Get-Mailbox | Out-Gridview
5/23/2018 7:15 AM Using Out-GridView Get-Mailbox | Out-Gridview Get-ExchangeServer | Out-GridView Get-User | Out-GridView © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

24 3 5/23/2018 7:15 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

25 5/23/2018 7:15 AM foreach Do something to each of the items in a list. To every mailbox, to every virtual directory, to every server.. © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

26 Using foreach $Mailboxes = get-mailbox
5/23/2018 7:15 AM Using foreach $Mailboxes = get-mailbox Foreach ($Mailbox in $Mailboxes) { get-user –identity $mailbox.userprincipalname } © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

27 2 5/23/2018 7:15 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

28 Where Just get the information you need, from any command
5/23/2018 7:15 AM Where Just get the information you need, from any command © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

29 5/23/2018 7:15 AM Using Where Get-Mailbox | Where {$_. AddressPolicyEnabled –eq $False} Get-ExchangeServer | Where {$_.Name –like “SG*”} © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

30 1 5/23/2018 7:15 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

31 5/23/2018 7:15 AM Export-CSV The key command for making it easy to generate reports and manipulate other date outside of Exchange © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

32 5/23/2018 7:15 AM Using Export-CSV Get-WebServicesVirtualDirectory | Select Server,InternalURL,ExternalURL | Export-Csv –NoTypeInformation .\EWSVirtualDirectories.CSV Get-Mailbox | Get-MailboxStatistics | Select DisplayName,TotalItemSize | Export-Csv –NoTypeInformation .\MailboxSizes.CSV © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

33 What is YOUR top Powershell command for Exchange?
Thank you! Hopefully these Powershell commands will make your life, as an Exchange admin a little easier Let me know either now, or on What is YOUR top Powershell command for Exchange?

34 Please evaluate this session
Tech Ready 15 5/23/2018 Please evaluate this session From your Please expand notes window at bottom of slide and read. Then Delete this text box. PC or tablet: visit MyIgnite Phone: download and use the Microsoft Ignite mobile app Your input is important! © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

35 5/23/2018 7:15 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.


Download ppt "The top ten PowerShell commands for Exchange"

Similar presentations


Ads by Google