O365_Installs_Connections.ps1

This script simplifies IT administrators installs for all of the required additional software/modules for a proper O365 PowerShell connection experience. Included in this script is a text based menu with options for creating connections to the different O365 services. Due to the nature of the Internet and that some installs are .exe downloads, some are .msi installs, and some are from a .zip file, each install can be slightly different. 

If you want access to all of the services, just go in numerical order through the install list. If you only want a few of the options, you have that choice, or if some of the modules are already installed, this script can provide you information for the ones you are missing. When you launch the .ps1 file, a text menu is presented. Just enter the numbered step that you wish to perform and the script will execute it.

Running the .ps1 file - installs

Launch Windows PowerShell using ‘Run as Administrator’.

Get-Execution Policy.

Make sure it is set to unrestricted, using this cmdlet if it is not already properly set:
Set-ExecutionPolicy Unrestricted

Launch the O365_Installs_Connections.ps1 file from where ever you have it saved.

Now just go down the steps one by one starting at #11 through 20. You’ll get confirmations on the software/modules that are already installed. The script doesn’t always know when a specific install is complete, therefore you could see some installs progressing on the desktop.

Steps 14 and 15 are installs that need a reboot afterwards. You can select one or both of them, then do the reboot. The reboot process allows the newly added PowerShell modules to become fully known by the OS.

I’ve added step #30, so you can make sure that the WinRM (PS remoting) service is working on the client. Skype for Business module is the only one that seems to have an issue when PS remoting is not working. It will prompt you during the logon process if it’s not started:

I’m leaving this up to you and your environment, as some people don’t have this issue and others don't need the Skype for Business Online Module loaded onto their machine. I’m an engineer about choice and I know diverse people operate using different processes.

Searching the Internet doesn’t take long, but steps 31-33 launch your default browser directly to the various PowerShell download sites. For this script and the O365_Logon Module, you need at least PowerShell version 3.0 or higher. Windows 7 shipped with v2.0, and these scripts do work with Windows 7 SP1, when PS v3.0 is installed.

The script provides the web site links instead of a silent install, as there are different options for the installs and a reboot is required. Plus, there could be other side effects imposed on your system that you should have more control over with the installs. PS upgrades are something you need to perform yourself and be aware of the impacts on your system. Windows 8 and Windows Server 2012 shipped with PowerShell v3.0. PowerShell v4.0 shipped with Windows 8.1 and Windows Server 2012 R2. 

Running the .ps1 file – Logons

Launch the O365_Installs_Connections.ps1 file (Interestingly enough, you no longer need to launch PS as an administrator. Still need Execution Policy set to unrestricted though.)

Now that your computer is setup and ready to use the different logon modules, you have several choices in connecting to your tenant. I prefer the simpler process of leveraging the O365_Logon module with directions on the blog site about the module. However, you are also welcome to launch this O365_Installs_Connections.ps1 file and just select one of the top options (1-5) to log onto any of the listed services: 

One of the limits of using this .ps1 file for logging on, is that once you are logged into O365, the script exits. Yes you are at the PS prompt and can do anything you need, but you’ll have to relaunch the .ps1 file to re-use any of its’ features. The O365_Logon module has more options to work within it and I think it’s much easier to use overall.

Conclusion

There you have it, installation made easier. I hope these scripts and modules assist you in getting your client machine(s) setup to leverage the power of PowerShell for your O365 experience. Good luck and have a happy online experience.

O365_Installs_Connections.ps1