SqlDatabaseMailSetups is used to manage SQL Server Database Mail.
Note
|
Database Mail XPs can be enabled using the resource |
Source |
|
DSC Resource |
|
Documentation |
-
Target machine must be running Windows Server 2012 or later.
-
Target machine must be running SQL Server Database Engine 2012 or later.
-
Target machine must be running SQL Server Agent.
-
Target machine must have enabled Database Mail XPs.
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
DefaultInstanceName |
String |
Default SQL InstanceName |
Default: |
|
Mandatory |
Hashtable[] |
List of SQL database mail setups. |
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
AccountName |
Key |
String |
The name of the Database Mail account. |
|
InstanceName |
Key |
String |
The name of the SQL Server instance to be configured. |
|
ServerName |
String |
The host name of the SQL Server to be configured. Default value is the current computer name. |
||
EmailAddress |
Mandatory |
String |
The e-mail address from which mail will originate. |
|
MailServerName |
Mandatory |
String |
The fully qualified domain name (FQDN) of the mail server name to which e-mail are sent. |
|
ProfileName |
Mandatory |
String |
The name of the Database Mail profile. |
|
DisplayName |
String |
The display name of the originating email address. Default value is the same value assigned to the parameter |
||
ReplyToAddress |
String |
The e-mail address to which the receiver of e-mails will reply to. Default value is the same value assigned to the parameter |
||
Description |
String |
The description for the Database Mail profile and account. |
||
LoggingLevel |
String |
The logging level that the Database Mail will use. |
|
|
TcpPort |
UInt16 |
The TCP port used for communication. |
Default: |
|
Ensure |
String |
Specifies the desired state of the Database Mail account. When set to |
|
SqlDatabaseMailSetups:
DefaultInstanceName: MSSQLSERVER
MailSetups:
- ServerName: 'Servername'
InstanceName: 'DSCSQLTEST'
AccountName : 'MyMail'
ProfileName : 'MyMailProfile'
EmailAddress: '[email protected]'
ReplyToAddress: '[email protected]'
DisplayName : 'mail.company.local'
MailServerName: 'mail.company.local'
Description : 'Default mail account and profile.'
LoggingLevel: 'Normal'
TcpPort: 25
- ServerName: 'Servername'
InstanceName: 'DSCSQLTEST'
AccountName : 'MyMail2'
ProfileName : 'MyMailProfile2'
EmailAddress: '[email protected]'
ReplyToAddress: '[email protected]'
DisplayName : 'mail.company.local'
MailServerName: 'mail.company.local'
Description : 'Second Default mail account and profile.'
LoggingLevel: 'Normal'
TcpPort: 25