Connect to Office 365 with Powershell

Using the Office 365 web interface to manage a tenant isn’t always the most ideal choice, based on what you’re trying to accomplish, especially if you would like to automatic or perform bulk tasks. Luckily Microsoft provides cmdlets that let you connect to Office 365 with Powershell.

Prerequisites

Install Microsoft .NET Framework 4.5.x

Install Windows Management Framework 3.0 or 4.0

Install Microsoft Online Services Sign-In Assistant for IT Professionals RTW

Install Azure AD Module for Windows PowerShell (x86 or x64)

Launch Powershell

You will want to right click Powershell and use Run as Administrator.

Load Required Modules

Once you have Powershell launched, the first thing you will want to do is load modules that you will need to connect to Office 365 using Powershell. Issue the following command in the Powershell window to load the MsOnline module.

Import-Module MsOnline

Office 365 Credentials

Now that you have the MsOnline module loaded you’re going to need to get and store your Office 365 credential in a variable. Issue the following command in the Powershell window. Once you do, it will launch a window requesting your username and password for Office 365.

$cred = Get-Credential

Getting Office 365 Credential

Connecting to Office 365

With the credential stored you can now use it to connect to the service.

Connect-MsolService -Credential $cred

If authentication was successful you are now connected to your Office 365 organization and can manage your service from there.

Connect to Office 365 with Powershell

Checking Registry Binary Values With Labtech

If you’re one of the managed service providers who is actively using Labtech for more than just remotely logging into machines then you’re already above those that are not . If you’re digging in and writing your own scripts then that’s another notch for you. Labtech is a very powerful tool when it is used correctly.  You might come across the need to write a script that will perform the task of checking registry binary values with Labtech. There is a gotcha that you should be aware of that is present in atleast Labtech 2013.1. When performing a binary value registry check with the equals comparator you may notice that your check isn’t returning a success when it should be. Below is the solution to this problem.

Let’s say you’re looking for the following binary value to be present (in hex): 00,00,0F,4E,00

If you perform the registry check in Labtech scripting with that specific value, it will not return a success if the value matches. The reason for this is due to Labtech stripping the leading zeroes in the hex values when it pulls it from the registry.

To search for a binary value you simply need to strip the leading zeroes in your registry check. The correct representation of the above example would be: 0,0,F,4E,0

Stop Exchange 2010 From Changing Resource Calendar Subject Lines

If you’re using resource mailboxes in Exchange 2010 and have it automatically process meeting invites, then you may notice that the subject lines are getting stripped and replaced with the organizer’s name. Depending on how you are using the resource mailbox, this may be an undesired action. If you wish to leave the original subject in the calendar entry, run the following command in the Exchange Management Shell:

Set-CalendarProcessing -Identity ResourceMailbox -AddOrganizerToSubject $false -DeleteSubject $false

Install .NET Framework 3.5 on Windows Server 2012

If you try to install .NET Framework 3.5 on Windows Server 2012, using the Server Manager and accepting the defaults, you will get an error stating that the source files could not be found. During the installation process Windows Server 2012 does not copy the required files for installation of .NET Framework 3.5 as it did in Windows Server 2008 R2. On the confirmation screen after selecting the .NET Framework 3.5 Features, you’ll notice a yellow bar telling you that an alternate path to the data files needs to be specified. Near the bottom of the window is an option to Specify an Alternate Source Path. Click this and specify the following path, substituting X with your optical drive with the Windows Server 2012 media:

X:\Sources\SxS

Now the installation should complete without any issues.

Page 1 Page 2 Page 3 Page 4 Page 7