Ask the Community
Groups
FAQ: How do I manually connect to Office 365 remote PowerShell? - Connect IT Community | Kaseya
<main> <article class="userContent"> <p>To connect to the Office 365 remote PowerShell, type the follwoing 3 commands in your local PowerShell:</p> <p><em>$o365cred=get-credential</em></p> <p><em>$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri <a href="/home/leaving?allowTrusted=1&target=https%3A%2F%2Fps.outlook.com%2Fpowershell%2F">https://ps.outlook.com/powershell/</a> -Credential $o365cred -Authentication Basic –AllowRedirection</em></p> <p><em>Import-PSSession $session</em></p> <p>If you get an error at this stage about the execution of scripts being disabled on the system, you should close Powershell and run again as Administrator. Then run the following command to allow the scripts to execute and start the sequence of commands again.</p> <p><em>set-executionpolicy RemoteSigned</em></p> <p> </p> <p><em><em>Updated: April 15, 2016</em></em></p> </article> </main>