Connecting remotely via PowerShell to Office 365


 


Creating a new PowerShell session to administer remotely your Office 365 domains and users couldn’t be easier.


And Windows PowerShell Integrated Scripting Environment (ISE) makes it even easier since you can write and save your scripts using a single Windows-based graphic user interface.


To connect remotely to Office 365 just launch a new PowerShell command prompt and execute the following commands:


 


$LiveCred = Get-Credential


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


Import-PSSession $Session




Once you’re done, just close the session using the following command:


Remove-PSSession $Session

 


Alternatively just use the attached script on PowerShell ISE.


 


 

Leave a Reply

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>