How to configure SharePoint Outgoing Email Settings Using PowerShell

How to configure SharePoint Outgoing Email Settings Using PowerShell

Here is a little script that lets you configure SharePoint Outgoing Email Settings using Power Shell.

#Vlad Catrinescu  www.vladcatrinescu.com
$SMTPServer = “192.168.1.20”

$EmailAddress = “svcfarm@vlad.loc”
$ReplyToEmail = “svcfarm@vlad.loc”

Try
{
Write-Host -ForegroundColor White ” – Configuring Outgoing Email…”
$loadasm = [System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint”)
$SPGlobalAdmin = New-Object Microsoft.SharePoint.Administration.SPGlobalAdmin
$SPGlobalAdmin.UpdateMailSettings($SMTPServer, $EmailAddress, $ReplyToEmail, 65001)
}
Catch
{
Write-Host “Failed”
}

Say Thanks if it helped 🙂

No ratings yet.

Please rate this

 
Comments

No comments yet.

Leave a Reply