Changing Exchange Online Settings with PowerShell

David Meego - Click for blog homepageIn my previous article: #MSDynGP Microsoft Dynamics GP and SMTP Email Failing, I mentioned that it was possible to check and/or change settings for your Exchange Online client.

There are a number of settings which can only be changed using PowerShell as they don’t have any user interface options available. However, many of the articles that provide the details on the settings never say how to actually get PowerShell working to use the settings.

This is where this article comes in …..

After some research I now have the steps to connect PowerShell to an Exchange Online instance so you can view and change settings not supported via the admin user interfaces.

Note: With the commands below, enter each command separately so you can see that it has completed successfully.

Connecting to Exchange Online

Start PowerShell using Run as Administrator, then run the commands below:

Set-ExecutionPolicy RemoteSigned -Force
Install-Module -Name ExchangeOnlineManagement -RequiredVersion 2.0.5
Connect-ExchangeOnline -UserPrincipalName <AdministratorEmailAddress>

Testing the Connection

Run the command below, if it lists the mailboxes on the Exchange Online Server, you have a working connection:

Get-Mailbox

Changing or Checking the SMTP Authentication setting

Set-TransportConfig -SmtpClientAuthenticationDisabled $false
Get-TransportConfig | Format-List SmtpClientAuthenticationDisabled

Changing or Checking the Legacy TLS setting

Set-TransportConfig -AllowLegacyTLSClients $true
Get-TransportConfig | Format-List AllowLegacyTLSClients

Allow Organization Customization

This option is needed if you want to change default spam filter settings.

Enable-OrganizationCustomization

Disconnecting from Exchange Online

Disconnect-ExchangeOnline
Set-ExecutionPolicy Restricted -Force
Exit

Note: With the commands above, enter each command separately so you can see that it has completed successfully.

 

Hope this helps save you the time it took me to gather all the commands together

David

This article was originally posted on http://www.winthropdc.com/blog.

7 thoughts on “Changing Exchange Online Settings with PowerShell

  1. Hello Sir,
    I am well connected with Exchange Online. Get-mailbox is worked.
    But when I run Set-TransportConfig command in powershell it gives me error
    Set-TransportConfig : The term ‘Set-TransportConfig’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a p
    ath was included, verify that the path is correct and try again
    So Can you Please suggest where we run the command & How ?
    Thanks for your Support !

    Like

      • Hello David,

        yes I do same cut & Paste in my powershell but the powershell says ‘Set-TransportConfig’ is not recognized as the name of a cmdlet, function, script file, or operable program.

        So All the command are running on powershell only or the Set-TransportConfig will run on different
        place.

        Thank You
        Tarun yadav

        Like

  2. I’ve done the suggested settings through powershell. Does it take a while for it to be effective? We are still on GP Dyanmics 2015 and will be upgraded soon. But I need the GP Dynamics to work in the meantime. So far no luck with emailing vendor remittances. It keep saying “Connection to MAPI server is not available.”

    Like

Please post feedback or comments

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.