In this article, we will learn how to use remote PowerShell for connecting to Office 365 (Windows Azure Active Directory).
This article is tagged under “PowerShell Nuggets”, meaning the style is KIS (Keep It Simple!) In case that you want to read more detailed explanation, use the following link: How to use Remote PowerShell for managing Office 365
Step 1: Download and install required components
Before we can start the remote PowerShell session to Office 365, we need to download the required cmdlets. Additional pre-requirement is to: install the: Office 365 sign in assistant.
You can find the required software components using the following links:
1. Microsoft Online Services Sign-In Assistant
You can download the Microsoft Online Services Sign-In Assistant by using the following link:
Microsoft Online Services Sign-In Assistant for IT Professionals RTW
2. Office 365 Powershell cmdlets
You can download the windows Azure Active Directory Module for Windows PowerShell by using the following link:
Windows Azure Active Directory Module for Windows PowerShell
Step 2: Run as Administrator
To be able to change the PowerShell Execution Policy, we need to run PowerShell console, by using the option: Run as administrator.
Right click on the Microsoft Online Services Module for Windows PowerShell icon and chose the option: Run as administrator.
Step 3: Setting the PowerShell Execution Policy
PowerShell security policy (“Execution policy”) can be defined by using one of the following options (modes): Restricted, AllSigned, RemoteSigned, and Unrestricted.
(The default mode is: Restricted).
To change the Execution policy open the Microsoft Online Services Module for Windows PowerShell and type the command:
Step 4: Connect to Office 365 by using Remote PowerShell
Open the Microsoft Online Services Module for Windows PowerShell and Type (or copy and paste) the following command:
A pop out windows will appear. Type your credentials by using the UPN (user Principal name) format. For example [email protected]
Congratulations! You are now connected to the Office 365.
PowerShell Interface is a little bit “stingy” in providing Indication such as: “you are now connected”. In the PowerShell environment, the fact that we did not get any error message indicates that “everything is O.K” (most of the times).
Step 5: Verifying the remote connection
Q: How can we know if the remote session was successfully created?
A: To verify that we are connected, we can use the most basic Office 365 cmdlets:
Watch the Video: Connect to Office 365 by – using Remote PowerShell
We really want to know what you think about the article