Showing posts with label Office365. Show all posts
Showing posts with label Office365. Show all posts

Monday, 10 November 2014

Connecting to Office365 using PowerShell for Remote Management

You can using PowerShell from an on-premise server to manage an instance of Office365 in Microsoft's cloud. It can be useful to manage more of the complex Exchange, Lync and SharePoint configuration settings that are available.

Firstly open an Administrative PowerShell box, I did this from Windows Server 2012 R2 copy and paste the following command into the PowerShell window.

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

This will invoke a credentials window that you must enter the Global Administrator account for the Office365 subscription. It should be in the format username@domain with the corresponding password.


The next command is the following to create a new session;

Import-PSSession $session


Once this command has completed you can use the following two PowerShell commands to create to see what commands are available in the Office365 PowerShell module that has been imported.

Get-Module ModuleName

Get-Command –Module ModuleName


To confirm it is working I did a Get-Mailbox and PowerShell returned a list of all of the Office365 mailboxes active on the subscription. 



Saturday, 20 September 2014

Configuring SMTP Relay on Office365 for a LOB Application

You are required to configure a LOB Application (in this case a Telephony PBX) to send e-mails using SMTP from Outlook365. TechNet (http://technet.microsoft.com/en-us/library/dn554323(v=exchg.150).aspx) provides a fairly decent guide but I thought I would document it myself as I got lost by some of the out of date steps.
To make this configuration change you must have the public IP address that the LOB Application is using to connect to the internet, this is how Office365 authenticates the application. It also mitigates against Office365 becoming an open relay.
The first stage is to create a new Exchange Inbound Connector this is done by connecting up to the Office365/Exchange ECP control panel. You can use the following address https://outlook.office365.com/ecp with your Office365 administrator credentials.

When you have logged into the Exchange ECP click Mail Flow and Connectors use the + symbol to create a new inbound connector.

Give the connector a descriptive name, ensure Enable Inbound Connector is selected. In this instance I have selected On-Premises, for good practice I also entered a description. From the Sender Domains section use the + symbol and configure it with an asterisk. This will allow mail to be sent to any domain.

Now under the Sender IP Addresses use the + symbol again and enter the public IP address the LOB Application is using to connect out to the internet. When this is done click Save.

You then use the MX Record configured for the domain as the SMTP Relay server for your LOB Application, you can find this from Office365 but I prefer Mx Toolbox.

Now reconfigure the LOB Application to point to the MX Record Hostname, on port 25.