To totally unlock this section you need to Log-in
Login
When you start Windows PowerShell, you're in the Windows PowerShell session of your local computer. A session is an instance of Windows PowerShell that contains all the commands that are available to you.
The Windows PowerShell session of your local computer, called the client-side session, has only the basic Windows PowerShell commands available to it.
By connecting to the cloud-based service, you connect to the Microsoft datacenter's server environment, called the server-side session. This contains the commands used in the cloud-based service.
Connecting to Microsoft Cloud Services
To begin working on cloud directly through Powershell we have to install 2 important components:
NOTE: you'll can download all these packages from this article, viewing the section Download at the bottom of this article.
If you encounter issues during the Microsoft Azure AD Module installation process, like the following:
You'll have to install the Microsoft Online Services Sign-In Assistant for IT Professionals BETA component instead of the Microsoft Online Services Sign-In Assistant for IT Professionals RTW.
After you'll have installed the BETA version you'll install without any problem the Microsoft Azure AD Module.
NOTE: the Microsoft Azure AD Module needs .NET Framework 3.5 installed on the system.
Click Start, point to All Programs, click Accessories, click Windows PowerShell, and then click Windows PowerShell or Windows Azure Active Directory Module for Windows PowerShell with administrative privileges.
Run the following command (the following command will ask you administrative cloud credentials (for example, Exchange Online administrator's credentials):
$LiveCred = Get-Credential
In the Windows PowerShell Credential Request window, type the credentials of an account in your cloud-based organization. Then, click OK.
Run the following command:
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
NOTE: The AllowRedirection parameter enables cloud-based organizations in datacenters all over the world to connect Windows PowerShell to the cloud-based service by using the same URL.
Run the following command:
Import-PSSession $Session
Commands that are used in the cloud-based service will now be imported into the client-side session of your local computer, as tracked by a progress bar. When this process is complete, you can run these commands.
When running the command “Import-PSSession $Session” it would return the error message below.
To resolve this, first check the current policy and then change it to Unrestricted.
1. Check policy with the command:
Get-ExecutionPolicy
2. If it returns “Restricted”, then change it to unrestricted with the command:
Set-Executionpolicy -ExecutionPolicy Unrestricted
Disconnect Windows PowerShell from the cloud-based service
When you're finished using the server-side session, always disconnect Windows PowerShell by running the following command:
Remove-PSSession
For example, to disconnect from the server-side session that is defined by the $Session variable, run the following command:
Remove-PSSession $Session
Important: If you close the Windows PowerShell window without disconnecting from the server-side session, your connection will remain open for 15 minutes. Your account can have only three connections to the server-side session at one time.
Download
To download the attachments of this article you'll need to be registered and logged on. Sorry for the inconvenience.
[wpfilebase tag="file" id=157 /]
[wpfilebase tag="file" id=158 /]
[wpfilebase tag="file" id=159 /]
Office 365 is a good way to move on cloud some core services, like e-mail. In a mid-big enterprise is essential to manage the cloud environment by using Powershell capabilities, like on Exchange 2010 or Exchange 2013, and to do that you’ll need to configure your access and connection on Powershell.
Read how to do that correctly on HeelpBook:
Connect Windows PowerShell to the Office 365 service – http://heelpbook.altervista.org/2014/connect-windows-powershell-to-the-office-365-service/ #office365 #howto #microsoft #guide #tutorial @heelpbook