PowerShell Cmdlets of Office 365: They are a Changin’

Microsoft’s cloud offering, Office 365, is in a constant state of flux. This state is driven by the amount of changed, additions and features that are made to the service. For customers, this state of change can be a bit bewildering, but Microsoft has provided some guidance on the changes with their Roadmap page for Office 365. This roadmap can be found here :

https://products.office.com/en-us/business/office-365-roadmap



Notice the stages of feature releases. What you won’t see is PowerShell changes specifically declared. Just because the changes are not declared, does not mean the changes are not present. So how do we find those changes?

Using PowerShell to Find PowerShell Changes

Office 365 PowerShell covers many services – Exchange Online, SharePoint Online, Skype for Business, Azure, Rights Management (recently renamed), Security and Compliance and more. To discover these cmdlets we need to make a connection to each of the services that are hosted in Office 365. The question is, how do we find those connections for PowerShell.

First, start with your favorite search engine and begin looking into each service. Here are some sample search terms that I’ve used to find the answers and get official documentation on connecting:

Search Terms: Connect PowerShell Exchange Online
Search Terms: Connect PowerShell SharePoint Online
Search Terms: Connect PowerShell Skype for Business
Search Terms: Connect PowerShell Azure
Search Terms: Connect PowerShell Security and Compliance Center

Each one of these services provides access via PowerShell from your local workstation over an SSL connection:



Recent announcements and changes around the Security and Compliance Center and Exchange peeked my curiosity on the changes that were occurring in the service:

SharePoint and Exchange Online eDiscovery Transitioning to Office 365 Security & Compliance Center

This raised the following questions for me:

  • What other cmdlets would be changing?
  • What cmdlets might be going away?
  • Was there any way to keep track of them?

How to Connect to Each Office 365 Service?

Here is a quick list of Microsoft Links on how to connect to each of the above services:

With each connection we can gather all the cmdlets for each of these connection points. Each connection provides unique module names to report on. Once connected, we can gather up a list of cmdlets from each Module and store this in a file for later reference. Why do this? For consultants, knowing what the latest or newest of something in a product helps give us a leg up and greater understanding so we can assist our customers with their environment. For engineers that directly support their systems, knowing what cmdlets are available and what has changed helps with performing the job better.

To export the list to a file, simply use one liners like the below:

$Date = get-date -Format "MM.dd.yyyy-hh.mm-tt"
$Name = "Azure"
get-command | where {$_.ModuleName -eq $Name} | select-object name > "c:\Scripting\PowerShellCmdlets\$Service-$Date.txt"

The above code will work for the cmdlets in the Azure PowerShell Module. Other modules can be processed in the same manner.

About a week or two after checking for this, a script I had writing (which I will go through in my next post) found that two cmdlets were added in the Exchange Online set of cmdlets. These cmdlets were added to the PowerShell module for Exchange. Also, one cmdlets was added to Security and Compliance Center as well. After that I added a way for my script to email me and I have it scheduled to run once per day. So now I get a daily report of any changes in Powershell for various (but not all) modules for Office 365 PowerShell.

The cmdlets lists are stored on a file server and I can open a file from the previous day or week and see what cmdlets were available at that point in time:



** Note ** You can even go as far as to restrict access to remote PowerShell for a service if you want as well. See this LINK for an example of how to do this.

How to script for this?

Look for a post on Friday on how to create a script that will connect to each service, record the cmdlets available per module and then send a notification email if the amount of cmdlets has changed from week to week. I explain each step and decision as the script is built and provide a completed script at the end. After the post is dropped, let me know in the comments if you would like the code put in the TechNet Wiki or somewhere.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s