DNS creating PTR record with SET-WMIInstance


here little function wrote create ptr record

#example:  new-dnsptrrecord mydc1.mydomain.local 99.99.99.10.in-addr.arpa 10.in-addr.arpa zzzz10.mydomain.local.    function new-dnsptrrecord ($dnsserver,$reverseip,$zone,$record) {  set-wmiinstance -namespace root\microsoftdns -class microsoftdns_ptrtype `  -argument @{`  					dnsservername = $dnsserver;  					containername = $zone;  					domainname = $zone;  					ownername = $reverseip;  					recorddata = $record;  					recordclass=1;`  					ttl = 3600; `  	} -computername $dnsserver -credential (get-credential)  }  


the ptr record created, after end of function got weird error message:

format-default : following exception occurred while retrieving members: "not found "

    + categoryinfo          : notspecified: (:) [format-default], extendedtypesystemexception
    + fullyqualifiederrorid : catchfrombasegetmembers,microsoft.powershell.commands.formatdefaultcommand

any idea ?


cyreli

kazun, trying ? function works flawlessly you, without return error message ?


cyreli


want say,what function works without error,but pass incorrect parameters function.


Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

WIMMount (HSM) causing cluster storage to go redirected (2012r2 DC)

Failed to delete the test record dcdiag-test-record in zone test.com

Azure MFA with Azure AD and RDS