' Create a Mail Exchanger DNS Record
strDNSServer = "atl-dc-03.fabrikam.com"
strContainer = "fabrikam.com"
strOwner = "atl-srv-01.fabrikam.com"
intRecordClass = 1
intTTL = 600
intPreference = 0
strMailExchanger = "mailexchanger.fabrikam.com"
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & _
"\root\MicrosoftDNS")
Set objItem = objWMIService.Get("MicrosoftDNS_MXType")
errResult = objItem.CreateInstanceFromPropertyData _
(strDNSServer, strContainer, strOwner, intRecordClass, intTTL, _
intPreference, strMailExchanger)