Using remote PowerShell + Running PowerShell SCRIPT
Using remote PowerShell + Running PowerShell SCRIPT
The following section includes a description of the process required for creating a remote
PowerShell session to Office 356 and Exchange Online.
Step 1: Download + install the required software components
To be able to create a remote PowerShell session to Office 365, we will need to download +
install the following software components:
You can find the required software component using the following links:
1. Office 365 Sign-In Assistant Microsoft Online Services Sign-In Assistant for IT
Professionals BETA
[Link]
2. Office 365Powershell Windows Azure Active Directory Module for Windows
PowerShell
[Link]
Step 2: Running Office 365 remote PowerShell
1. Run as Administrator (Elevated PowerShell)
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
choose the option: Run as administrator.
Page: 1 [[Link] | Using remote PowerShell + Running PowerShell SCRIPT]
2. Setting the PowerShell Execution Policy
the cmdlets for Exchange Online are imported through the internet, so first, you need
to change the PowerShell execution policy to allow remotely signed modules to be
loaded.
To change the default PowerShell Execution policy, open the Microsoft Online Services
Module for Windows PowerShell and type the command:
Set-ExecutionPolicy Unrestricted -force
Step 3: Running a PowerShell script file
In case that you need to run a PowerShell script file, use the following procedure:
1. Save the Script file to local disk
Save the script file on your local drive. For example: save a script file named: [Link] to the
TEMP folder on drive C:
2. Locate the PowerShell script
Open the PowerShell console and “call” the script.
For example, in case that you save the PowerShell script to the TEMP folder, use the following
procedure:
Open the PowerShell Console and type: CD C:\TEMP
4. Execute\activate the PowerShell script
Call the PowerShell script by typing the following procedure:
Type the following charters: .\
Type the name of the script file (including the suffix). For example: Report.ps1
Press the ENTER key to activate the PowerShell Script
Note - and additional option is to use the Autocomplete future of PowerShell
Type the following charters: .\
Type the first 2 letters of the script file ( for example: re instead of report.ps1)
Hit the TAB key (the script name will be automatically completed)
Page: 2 [[Link] | Using remote PowerShell + Running PowerShell SCRIPT]
5. Use the PowerShell script menu
To execute the authentication process (remote PowerShell session) choose
the [0] menu: Login in to Office 365 using your Global Administrator credentials
A pop out authentication windows will appear
provide your global administrator credentials
The “green screen” display” the PowerShell cmdlets that are downloaded to the local desktop
Page: 3 [[Link] | Using remote PowerShell + Running PowerShell SCRIPT]