Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Changing database mail account SMTP servers

By Dennis Post,

Change @NewSMTP to a valid server name or IP address or leave NULL if you just want to generate the accounts as they are.

To skip the ping test, simply change @TestPing to 0.

If you have many accounts then it might be necessary to remove
@SQL = @SQL +
from the SELECT statement.
This will return each accounts TSQL in table format.

For SMTP authentication users, remember to change each users password before you run the generated script.
If there is only one account or only one password for multiple accounts then set the @PW variable.

Total article views: 665 | Views in the last 30 days: 2
 
Related Articles
FORUM

Auditing Account creation/changes

Trying to audit account creation and permission changes

FORUM

how to properly change the service accounts

how to properly change the service accounts

FORUM

CHANGING DB-OWNERSHIP TO SA ACCOUNT

CHANGING DB-OWNERSHIP TO SA ACCOUNT

FORUM

How to change dbo-login account is changed from DOM1\SQL_AC1 to DOM2\SQL_ACC1

Changing dbo_login Account to differnt one

FORUM

SSRS - Changing Service to use Domain Account

WMI problems when changing to domain account - can't even change back.

Tags
database mail    
smtp    
 
Contribute