Tip: a few useful PowerShell scripts for Exchange and Office 365 Admins


Recently there has been some helpful activity over on the Microsoft Script Center for Exchange and Office 365 administrators. Here are 3 scripts that we wanted to call out, as well as a bit of an overview of what they do:

  • Install Exchange 2016 Pre-requisites.ps1 – makes it easier to install Exchange 2016 prerequisites
  • O365_Installs_Connections.ps1 – makes it easier to prepare machines from which you administer Office 365
  • O365_Logon Module – an easier way to log into Office 365 services using PowerShell

Please see specific script downloads for support options and more details.

Install Exchange 2016 Pre-requisites.ps1

This script installs and adds all of the needed software, features, roles, and server settings to a Windows Server 2012 R2 Operating System in preparation for an Exchange 2016 installation. No more looking for which roles or which required software to install. Simply launch this script, select an option, and it goes out to the Internet, gets the installs, silently completes them, and adds all of the required roles and features. After a reboot, you can then install Exchange 2016.

image

O365_Installs_Connections.ps1

This script simplifies IT administrators installs for all the required additional software/modules for a proper Office 365 PowerShell connection experience. Included in this script is a text based menu with options for creating connections to the different Office 365 services. Due to the fact that some installs are .exe downloads, some are .msi installs, and some are from a .zip file, each install can be slightly different. You can find additional information on how to use this ps1 file in this blog post.

image

O365_Logon Module

This is a PowerShell module, written to quickly log into any or all the Office 365 services with a simple verb-noun CMDLet format.

  • Connect-CCO – connect to the online Compliance Center
  • Connect-EXO – connect to Exchange online
  • Connect-SPO – connect to SharePoint Online
  • Connect-SfbO – connect to Skype for Business Online
  • Connect-O365 – connect to all four services with one CMDLet

With this installed onto your local client machine, with a single CMDLet, all the steps to log into Office 365 are combined for you. You just have to put in the proper credentials and PowerShell does all the work. Additional information on how to use this module is in this blog post.

image

Conclusion

There you have it; a few fast, simple ways to help you get your job done a little bit easier and a little bit quicker.

And – this goes without saying – please validate that things will work in your environment!

Mike O'Neill

Comments (9)
  1. Jos Verlinde says:

    another one-stop-shop alternative is the Connect-O365 script that connects to all O365 services in a simple and consistent way.
    In addition to the above is also covers Azure RMS and SharePoint PNP

    One simple install from the PSGallery :

    Install-script connect-o365
    connect-o365 -install #Optional to download and install all external modules
    connect-o365 -exo -spo -sfb -ucc -pnp -rms -account admin@contsoso.com

  2. Jos Verlinde says:

    another one-stop-shop alternative is the Connect-O365 script that connects to all O365 services in a simple and consistent way.
    In addition to the above is also covers Azure RMS and SharePoint PNP

    One simple install from the PSGallery :

    Install-script connect-o365
    connect-o365 -install #Optional step to download and install all external modules
    connect-o365 -exo -spo -sfb -ucc -pnp -rms -account admin@contsoso.com -persist

  3. Jesper Bernle says:

    Fantastic! Thanks a million!

  4. Joshua Wortz says:

    Great list. I have two more scripts to add to the list that are essential for on premises exchange admins that I wrote about in my blog post.

    http://wp.me/p7XecG-2W

  5. sime3000 says:

    Hello Exchange Team,

    Thanks for posting this. A question about the “Install Exchange 2016 Pre-requisites.ps1” script…

    UCMA 4.0 is listed as a prerequisite for Exchange 2016 on Windows 2016 https://technet.microsoft.com/en-us/library/bb691354(v=exchg.160).aspx

    However UCMA 4.0 was released four years ago and is clearly not supported on Windows 2016 according to the UCMA 4.0 requirements on this page https://www.microsoft.com/en-us/download/details.aspx?id=34992

    So how is UCMA 4.0 a supported prerequisite for Exchange 2016 on Windows 2016 ?

    Looking forward to your timely response.

  6. Kazzan says:

    Nice pack of scripts! Thanks.

    But what about support MFA for PowerShell for Exchange? Do you have some meeting with Windows team? This really downsize option to consistent MFA deployment for Office 365 admins.

  7. sime3000 says:

    Hello Exchange Team,

    Thanks for posting this. A question about the “Install Exchange 2016 Pre-requisites.ps1” script…
    UCMA 4.0 is listed as a prerequisite for Exchange 2016 on Windows 2016 https://technet.microsoft.com/en-us/library/bb691354(v=exchg.160).aspx

    However UCMA 4.0 was released four years ago and is clearly not supported on Windows 2016 according to the UCMA 4.0 requirements on this page https://www.microsoft.com/en-us/download/details.aspx?id=34992

    So how is UCMA 4.0 a supported prerequisite for Exchange 2016 on Windows 2016 ?

    Looking forward to your timely response.

    1. Haig says:

      It specifically says for “Windows Server 2012 R2”, there is no mention of Windows 2016.

  8. powerMapi says:

    Not sure if this is a good spot for this…but there’s a new PowerShell module called PowerMapi available that provides direct mapi calls via powershell cmdlets.

    For admins, being able to quickly build a profile, logon to it, and muddle around in a mailbox is always handy.

    A simple example:
    import-module PowerMapiLoader
    $sess=new-MapiSession OutlookProfileName
    $inbox=get-MapiFolder $sess Inbox
    $items=get-MapiContents $inbox -First 100

Comments are closed.

Skip to main content