Share via


Connecting Remote PowerShell Office 365

If you are managing Office 365 Exchange hosted mail systems and wish to connect to PS from your PC here are simple steps to get the work done. The remote PowerShell will provide you real easy way to manage your SMTP organization.

In this Example:

Office 365 SMTP domain we will connect too is @messagetalk.onmicrosoft.com and I am going to use my User name which has administrator privileges,<odedeal@l@messagetalk.onmicrosoft.com>

From administrator PS

  • Open PS with Administrator privileges
$LiveCred = Get-Credential

http://lh5.ggpht.com/-hA-U7UiQhe0/UVmJ28WMQxI/AAAAAAAAFZ0/NfmixU2U1GQ/image_thumb.png?imgmax=800

  • Run fallowing command ( don’t make any changes ) copy and paste into PS window.

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

http://lh6.ggpht.com/-VGJSkbwyXaM/UVmJ4AJABtI/AAAAAAAAFaE/CpXtwQCy0xI/image_thumb%25255B1%25255D.png?imgmax=800

  • Next run this PS
Import-PSSession $Session

http://lh6.ggpht.com/-3S7mCTWMW8Q/UVmJ5Te3BDI/AAAAAAAAFaU/U2CfdiG2_c8/image_thumb%25255B2%25255D.png?imgmax=800

http://lh5.ggpht.com/-ddZbm5AVtIk/UVmJ6hyhMhI/AAAAAAAAFak/lmbTTvRHLFc/image_thumb%25255B3%25255D.png?imgmax=800

Now we are connected we can see our mailboxes etc.

http://lh4.ggpht.com/-Ns6azzq6rwM/UVmJ76tL6GI/AAAAAAAAFa0/38FnvglIpp8/image_thumb%25255B4%25255D.png?imgmax=800

If we look from GUI we have same users , we can use GUI to manage these users now as well as PS from our management PC

http://lh5.ggpht.com/-FYDVBtEoD4s/UVmJ9AvzLmI/AAAAAAAAFbE/goEj_VzV9i8/image_thumb%25255B6%25255D.png?imgmax=800

Once we are done we can close the PS session with fallowing PS command

Remove-PSSession $Session

http://lh6.ggpht.com/-edPg5cGaKgk/UVmJ-TgPIQI/AAAAAAAAFbU/kQoh6EiJF8k/image_thumb%25255B7%25255D.png?imgmax=800

Respectfully,
Oz Casey, Dedeal ( MVP north America)
MCITP (EMA), MCITP (SA)
MCSE 2003, M+, S+, MCDST
Security+, Project +, Server +
http://smtp25.blogspot.com/ (Blog)
http://telnet25.wordpress.com/ (Blog)