Series: Part 1 Part 2 Part 3 Part 4

License Options

Overview

In the previous blog post I showed you how to connect to Azure Active Directory using PowerShell and assign a license sku to an Office 365 user which entitles a user for all the services contained therein. In many cases this is sufficient, but some organizations may have more specific needs regarding what services are available to its’ users. For instance, you may want to provision Exchange to your users after you’ve migrated from another mail service, but you want to wait a bit to deploy Sharepoint, Skype for Business, and Onedrive for Business until your users have gotten used to Office 365. To achieve this you’ll need to use selective license entitlement. This can be done in the Admin Center by deselecting the services that are included with a license sku,

but to do this in bulk we’ll need to use PowerShell.

Read more...

Series: Part 1 Part 2 Part 3 Part 4

The Basics

Overview

Licensing users for Office 365 services is pretty easy in the administrative center using your web browser, but if you have more advanced needs or you’re automating your Office 365 tenant configurations, you’re going to need PowerShell. However, licensing users with PowerShell is complex and can be a bit of a pain. In this blog series I’ll go over how to assign licenses to users and how to selectively enable the service plans contained in each license sku. We’ll even go over some advanced scenarios that will help you fully automate all your user licensing as well as reactively change or update user licensing as user roles change within your company.

Connect to Azure Active Directory

The first step to using PowerShell for Office 365 licensing is learning how to connect to the Office 365 environment so that we can run commands against our tenant. There are a couple of prerequisites:

Read more...

If you manage an Office 365 tenant then you may be interested in a new module I published to the PowerShell Gallery. The O365ServiceCommunications module can be used to retrieve messages regarding your tenant health status, incident closure, and general information about planned downtime or new features. The Office 365 Message Center lacks email alerting on incidents and this is definitely a gap that needs to be filled. You can use this module to script this automatic alerting and make your boss happy! You could even drop the event data returned into a SQL database and generate reports and track the health of your Office 365 tenant.

This module uses the Office 365 Service Communications REST API and you’ll need to be a global administrator for your tenant, or a delegated partner administrator in order to authenticate to the service.

Read more...

Detecting Key Presses

I haven’t blogged in quite a while, but recently I was inspired by this PowerShell.com PowerTip that gives us a method to detect key presses using low-level Windows API methods. I took this just a bit further and created a function that allows us to specify exactly which key we’d like to test for and will even check for multiple simultaneous keys (a chord).

Read more...

I recently ran into a problem when using Pester to test the validity of my PowerShell module manifests. My original idea for testing the manifest files came from Dave Wyatt’s tests for the Pester module itself. The first describe block he uses here runs several tests against the module manifest itself such as whether the manifest is versioned, has a valid GUID, and has a name.

One of the problems I sometimes run into when authoring a module is with exporting functions. Sometimes I’ll write a new function and think I’m all set to go but when I import the module the function doesn’t exist. After a few face-palms I’ll realize that I forgot to add the function to the FunctionsToExport array in the module manifest. With this in mind I wrote a test that checks if the functions that are exported from a module match the functions that are enumerated in the module folder itself:

Read more...

The Scripting Games are back for another year and the format has changed quite a bit. This year we’ll be treated to several monthly puzzles with solutions submitted publicly on the PowerShell.org website. July’s puzzle can be found here.

The Challenge

The goal is to create a PowerShell one-liner that is as short as possible and creates the output given in the example:

PSComputerName ServicePackMajorVersion Version  BIOSSerial
-------------- ----------------------- -------  ----------
Win81                                0 6.3.9600 00261-80123-18417-AA816
Read more...

I’ve been playing around with a trial version of PowerShell Studio 2015 an I must say it’s pretty nice! I don’t typically do GUIs with PowerShell, but if I did this would be an amazing tool. Overall there are some great features that really provide some value if you need to move up to a professional editor.

I thought I’d share the color scheme I’ve been using for the script editor:

Read more...

Exchange Online Clutter

Clutter is a new productivity aid in Exchange Online that helps save you time by separating your important messages from the rest of the muck that you get on a daily basis. A description of how this feature works can be found here. Clutter is optional and can be enabled by users should they choose to use the service.

Microsoft believes in Clutter so much, however, that they have decided to make it available by default on all new Exchange Online mailboxes starting in June. If this timeline doesn’t work for your organization, or you would rather give your users the choice to turn Clutter on, there are some new PowerShell cmdlets that you can leverage.

First, some prerequisites:

Read more...

In case you can’t tell, I get excited about the tools I use. ISE Steroids has become a go-to tool for my PowerShell scripting needs and has helped me get even better at doing what I do. ISE Steroids v2.0 RC2 was released a couple days ago and there are some great new capabilities that can help you customize the development experience even further. One very powerful feature is what Tobias calls ‘Make it Yours.’

Make it Yours is a set of features that allow you to add custom commands to context menus in PowerShell ISE. We have always had this in some respect using the ISE’s native object model. You can create custom add-ons which execute any blocks of PowerShell code that you like. Make it Yours takes this one step further and allows you to create commands that run from the Menu Bar or the right-click context menu, and you can now add custom tools into the Menu Bar’s Tools menu.

Read more...

If you haven’t heard of it yet, there is a useful plugin for PowerShell’s ISE editor called ISE Steroids. Quietly developed over the last couple years by PowerShell MVP Tobias Weltner, ISE Steroids adds professional IDE features to the ISE with the aim of helping you script better, faster, and with less effort. Yesterday saw the release of the second release candidate of ISE Steroids version 2.0 and a host of new features along with it.

One of my favorite features of the ISE Steroids is the color theming support. This gives you the capability to theme nearly every part of the script editor, console pane, xml editor and even the GUI itself. In the spirit of community, I would love to see the community start developing their own themes and sharing them. To prove I’m not a hypocrite, here is my first shared theme:

Read more...