PowerShell for Windows Admins

Jun 8 2013   5:49AM GMT

Creating DNS PTR records

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

When I was writing the DNS chapter of PowerShell in Practice I couldn’t get the CreateInstanceFromPropertyData method on the MicrosoftDNS_PTRType class to work. Revisiting DNS for AD management in a Month of lunches this time round I have access to the CIM cmdlets so can put the parameter names in. This gives usage like this. I’ve shown Invoke-WmiMethod and Invoke-CimMethod so you can see the parameter names:

Invoke-WmiMethod -Namespace root\MicrosoftDNS -Class MicrosoftDNS_PTRType `
-Name CreateInstanceFromPropertyData `
-ArgumentList “175.168.192.in-addr.arpa”, ‘server02’, ‘’,

Invoke-CimMethod -Namespace root\MicrosoftDNS -ClassName MicrosoftDNS_PTRType `
-MethodName CreateInstanceFromPropertyData `
-Arguments @{Containername = “175.168.192.in-addr.arpa”;
DnsServerName = ‘server02’; OwnerName = ‘’;
PTRDomainName =”ADMLServer02.admldns.test”}

If you have access to Windows 2012 then you are better off using the cmdlet

Add-DnsServerResourceRecordPtr –Name ‘54’ `
–ZoneName “175.168.192.in-addr.arpa” `
–PtrDomainName ‘ADMLServer01.admldns.test’ `
–ComputerName server02

Which ever method you use – you can easily create PTR records

 Comment on this Post

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: