-
Notifications
You must be signed in to change notification settings - Fork 57
DnsRecordMxScoped
dscbot edited this page Apr 12, 2025
·
5 revisions
| Parameter | Attribute | DataType | Description | Allowed Values |
|---|---|---|---|---|
| EmailDomain | Key | System.String | Everything after the '@' in the email addresses supported by this mail exchanger. It must be a subdomain the zone or the zone itself. To specify all subdomains, use the '*' character (i.e.: *.contoso.com). (Key Parameter) | |
| MailExchange | Key | System.String | FQDN of the server handling email for the specified email domain. When setting the value, this FQDN must resolve to an IP address and cannot reference a CNAME record. (Key Parameter) | |
| ZoneName | Key | System.String | Specifies the name of a DNS zone. (Key Parameter) | |
| ZoneScope | Key | System.String | Specifies the name of a zone scope. (Key Parameter) | |
| Priority | Required | System.UInt16 | Specifies the priority for this MX record among other MX records that belong to the same email domain, where a lower value has a higher priority. (Mandatory Parameter) | |
| DnsServer | Write | System.String | The host name of the Domain Name System (DNS) server, or use 'localhost' for the current node. Defaults to 'localhost'. |
|
| Ensure | Write | Ensure | Whether the host record should be present or removed. |
Present, Absent
|
| TimeToLive | Write | System.String | Specifies the TimeToLive value of the SRV record. Value must be in valid TimeSpan string format (i.e.: Days.Hours:Minutes:Seconds.Miliseconds or 30.23:59:59.999). |
The DnsRecordMxScoped DSC resource manages MX DNS records against a specific zone and zone scope on a Domain Name System (DNS) server.
This configuration will ensure a DNS MX record exists when only the mandatory properties are specified.
Configuration DnsRecordMxScoped_Mandatory_config
{
Import-DscResource -ModuleName 'DnsServerDsc'
Node localhost
{
DnsRecordMxScoped 'TestRecord'
{
ZoneName = 'contoso.com'
ZoneScope = 'external'
EmailDomain = 'contoso.com'
MailExchange = 'mailserver1.contoso.com'
Priority = 20
Ensure = 'Present'
}
}
}This configuration will ensure a DNS MX record exists when all properties are specified.
Configuration DnsRecordMxScoped_Full_config
{
Import-DscResource -ModuleName 'DnsServerDsc'
Node localhost
{
DnsRecordMxScoped 'TestRecord'
{
ZoneName = 'contoso.com'
ZoneScope = 'external'
EmailDomain = 'contoso.com'
MailExchange = 'mailserver1.contoso.com'
Priority = 20
TimeToLive = '01:00:00'
DnsServer = 'localhost'
Ensure = 'Present'
}
}
}This configuration will ensure a DNS MX record does not exist when mandatory properties are specified.
Note that the 'Priority' property value will be ignored when determining whether the record is to be removed.
Configuration DnsRecordMxScoped_Remove_config
{
Import-DscResource -ModuleName 'DnsServerDsc'
Node localhost
{
DnsRecordMxScoped 'TestRecord'
{
ZoneName = 'contoso.com'
ZoneScope = 'external'
EmailDomain = 'contoso.com'
MailExchange = 'mailserver1.contoso.com'
Priority = 20
Ensure = 'Absent'
}
}
}- DnsRecordA
- DnsRecordAaaa
- DnsRecordAaaaScoped
- DnsRecordAScoped
- DnsRecordCname
- DnsRecordCnameScoped
- DnsRecordMx
- DnsRecordMxScoped
- DnsRecordNs
- DnsRecordNsScoped
- DnsRecordPtr
- DnsRecordSrv
- DnsRecordSrvScoped
- DnsRecordTxt
- DnsRecordTxtScoped
- DnsServerADZone
- DnsServerCache
- DnsServerClientSubnet
- DnsServerConditionalForwarder
- DnsServerDiagnostics
- DnsServerDsSetting
- DnsServerEDns
- DnsServerForwarder
- DnsServerPrimaryZone
- DnsServerRecursion
- DnsServerRootHint
- DnsServerScavenging
- DnsServerSecondaryZone
- DnsServerSetting
- DnsServerSettingLegacy
- DnsServerZoneAging
- DnsServerZoneScope
- DnsServerZoneTransfer