Office 365 Powershell into a server KB1039659

In this article I will cover the basic way to connect to a 365 server with Powershell.

Right click on Powershell and run as admin

c:~>  Set-ExecutionPolicy RemoteSigned ( normal powershell only )
Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose
you to the security risks described in the about_Execution_Policies help topic at
http://go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
[Y] Yes [N] No [S] Suspend [?] Help (default is “Y”): Yes

You must answer YES !!!!!!

c:~>   $LiveCred = Get-Credential

then enter the admin creds for OWA

o365 logon 1

This is the next command:

c:~>   $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $LiveCred -Authentication Basic –AllowRedirection

Then:

c:~>  Import-PSSession $Session

And you should end up with this, if so you are good to run commands now O365 logon 2

 

pwillette 2/18/15

 

Leave a Reply