PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit...

69
Conference 2018 Mario Ivanov Data Centre Services, University of Victoria PowerShell tools for Exchange Administration

Transcript of PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit...

Page 1: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar

Conference 2018

MarioIvanovDataCentreServices,UniversityofVictoria

PowerShelltoolsforExchangeAdministration

Page 2: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar

Abitaboutmyself

Page 3: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar

EXCHANGETOOLSTOSET/RESET:

• Mailboxpermissions• Calendarpermissions• SendAspermissions• SendonBehalfpermissions• UnifiedVoicemessaging• Outofofficemessage

Page 4: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar

WhatisPowerShell?Built on the .NET Framework, PowerShell is a task-based command-line shell and scriptinglanguage; it is designed specifically for system administrators and power-users, to rapidlyautomate the administration of multiple operating systems (Linux, MacOS, Unix, andWindows) and the processes related to the applications that run on those operatingsystems.

Windows PowerShell introduces the concept of a cmdlet (pronounced "command-let"), asimple, single-function command-line tool built into the shell. You can use each cmdletseparately, but their power is realized when you use these simple tools in combination toperform complex tasks. Windows PowerShell includes more than one hundred basic corecmdlets, and you can write your own cmdlets and share them with other users.

Page 5: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar

Warning:PowerShellispowerful!

• Beginnersshouldalwaysstartwithnon-intrusivecommandletsi.e.startingwith“Get-”

• The“dangerous”onesstartwith“Set-”,“Remove-”etc.

Page 6: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar

Example

Get-Mailbox - returnsahugeamountofpropertiesbelongingtoanExchangemailbox,literallyabove200.Amongthem:

• Displayname• Databasename• Forwardingaddress,• Iftheyhaveapicture• IfhiddenintheGlobalAddressList

Page 7: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar

LoggingtotheExchangeserver

Page 8: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 9: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar

Consoleversions

Page 10: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar

SwitchingtoGUI• WindowsFormsa.k.a.WinformsWinFormsisagraphical(GUI)classlibraryincludedasapartofMicrosoft.NETFramework,providingaplatformtowriterichclientapplicationsfordesktop,laptop,andtabletPCs.BeingafirstgenerationGUIbuildingtechnology,WinFormsUIlayoutisverysimplisticandlimited.Controlsareplacedusingdistancefromthetop-leftpointofawindowandtheirsizeisexplicitlyspecified.Thesizeofcontrolscan'tcompensateautomaticallywhenresizingwindows…etc.(FromWikipedia)

• WPF

Page 11: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 12: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 13: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 14: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar

Mailboxpermissionstool

Page 15: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 16: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar

Mailboxpermissionstool

a

Page 17: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 18: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 19: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 20: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 21: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 22: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 23: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 24: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 25: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 26: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 27: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar

Frequentrequest:Pleasegrantuser1FullAccessandSend-As permissiononthefollowingmailboxes:Mailbox1Mailbox2Mailbox3Mailbox4Mailbox5Mailbox6andremoveuser2havinganyaccessontheabove.

Page 28: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 29: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 30: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 31: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 32: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 33: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 34: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 35: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 36: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 37: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 38: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 39: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar

Calendar permissions tool

Page 40: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 41: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 42: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 43: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 44: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 45: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar

Set-MailboxFolderPermission -Identity dsstesting107:\calendar -User wclarke -AccessRights Editor

Existing permission is a requirement

Add-MailboxFolderPermission -Identity dsstesting107:\calendar -User wclarke -AccessRights Editor

No Existing permission is a requirement

Page 46: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 47: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 48: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar

Unified voice messaging tool

Typicalrequestexample:

Pleasemakeext.8631toforwardtomailboxjpotton

Page 49: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 50: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 51: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 52: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 53: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 54: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 55: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 56: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 57: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 58: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 59: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar

Get-UMMailbox -ResultSize Unlimited | where {$_.Extensions -like $phone}

Get-UMMailbox -ResultSize Unlimited | where { if($_.Extensions –like $phone){$line=$_;break}}

$dummyArr=@(1)foreach ($dummyelement in $dummyArr) {

get-ummailbox -ResultSize Unlimited |where { if($_.Extensions -like $phone){$line=$_;break} }}

Page 60: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 61: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 62: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar

Set out of office message tool

Page 63: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 64: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 65: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar

<html><body>…..<br>…..<br>…..<br>…..

</body></html>

Page 66: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar
Page 67: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar

SUMMARY

Thank you!

Page 68: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar

Thank you!

Page 69: PowerShell tools for Exchange Administration · PowerShell tools for Exchange Administration. A bit about myself. EXCHANGE TOOLS TO SET/RESET: • Mailbox permissions • Calendar

The presentation can be downloaded from here

http://web.uvic.ca/~mivanov/BCNET/