AddByMX method of the PS_DnsServerResourceRecord class

Adds an MX resource record to a DNS server.


uint32 AddByMX(
  [in]  string                  ZoneName,
  [in]  string                  MailExchange,
  [in]  uint16                  Preference,
  [in]  datetime                TimeToLive,
  [in]  boolean                 AgeRecord,
  [in]  boolean                 AllowUpdateAny,
  [in]  string                  Name,
  [in]  boolean                 MX,
  [in]  string                  ComputerName,
  [in]  boolean                 PassThru,
  [in]  string                  ZoneScope,
  [out] DnsServerResourceRecord cmdletOutput


ZoneName [in]

Specifies the name of the zone.

MailExchange [in]

Specifies an FQDN for a mail exchanger. This value must resolve to a corresponding host (A) resource record.

Preference [in]

Specifies a priority, from 0 to 65535, for this MX resource record. A service attempts to contact mail servers in the order of preference from lowest priority value to highest priority value.

TimeToLive [in]

Specifies the Time to Live (TTL) value, in seconds, for a resource record. Other DNS servers use this length of time to determine how long to cache a record. The Start of Authority (SOA) record defines the default TTL.

AgeRecord [in]

Indicates that the DNS server uses a time stamp for the resource record that this method adds. A DNS server can scavenge resource records that have become stale based on a time stamp.

AllowUpdateAny [in]

Indicates that any authenticated user can update a resource record that has the same owner name.

Name [in]

Specifies the name of the host or child domain for the mail exchange record. To add an MX resource record for the parent domain, specify a dot (.).

MX [in]

If specified, creates a DNS Server Resource Record MX.

ComputerName [in]

Specifies a DNS server. If you do not specify this parameter, the command runs on the local system. You can specify an IP address or any value that resolves to an IP address, such as a fully qualified domain name (FQDN), host name, or NETBIOS name.

PassThru [in]

true to return the object that was modified by the method. By default, this method does not generate any output.

ZoneScope [in]

Name of the zone scope.

Windows Server 2012:  Not supported.

cmdletOutput [out]

Receives an embedded instance of the DnsServerResourceRecord class.


Minimum supported client

None supported

Minimum supported server

Windows Server 2012







See also