SharePoint 2016 Administration : Configure Outgoing Email Settings using PowerShell

After installation of SharePoint Server 2016 and done with the initial configurations of the Farm we can configure Outgoing Email Settings.

Outgoing Email configuration enables SharePoint users to monitor the SharePoint artifacts like List & Libraries. Along with that it allows Site Administrators to receive messages regarding Administrative issues.

In this article we will see to the steps and PowerShell Scripts involved in configuring Outgoing Email settings in SharePoint 2016 for a specific Web Application.

Launch “Central Administration Site”

Click on “Manage Web Applications” link under “Application Management”

1

Select the Web Application out of the list of available Web Applications

Click on “General Settings” Ribbon Control to select “Outgoing Email”

2

This launches the “Web Application Outgoing Email Settings” screen in the Modal Dialog

3

Now onwards we have two choices to configure the Outgoing Email Settings, the first one is to make use of the SharePoint User Interface as shown above or configure the settings using PowerShell Script to support automations scenarios.

In this article we see configuration done using PowerShell. Before we execute the corresponding PowerShell Commands, we would visit to the Web Application and see if it is accessible as shown below:

4

Next step is to execute the following PowerShell Script to update the Outgoing Email Settings:

PowerShell Script

  • Get handle on Web Application to which we want to apply Outgoing Email Settings

$webAppObj = Get-SPWebApplication -Identity http://sp-2016-dev

  • Once we are able to the get the Web Application Object, we will call the “UpdateMailSettings” Methods which accept following Parameters:

7.png

$webAppObj.UpdateMailSettings(“sp2016mail.prashant.com”,”do-not-reply@prashant.com”,”do-not-reply@prashant.com”, 65001)

  • Then finally call the “Update” method to persist the changes to the SharePoint Database

$webAppObj.Update()

Execution

  • Launch SharePoint 2016 Management Shell
  • Execute the commands as mentioned above

5

Once the commands get executed successfully we can go back to SharePoint Outgoing Email Settings to verify if the settings have been updated.

If execution has been completed without an error we would be looking at the properties saved as shown below:

6

That is it for this demo.

Hope you find it helpful.

Advertisements

Leave a Reply

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 )

Google+ photo

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

Connecting to %s