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
This is the next command:
c:~> $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $LiveCred -Authentication Basic –AllowRedirection
c:~> Import-PSSession $Session