question

AchmadFathurRizki-6146 avatar image
0 Votes"
AchmadFathurRizki-6146 asked RichMatheisen-8856 answered

Add-DnsServerResourceRecordPtr PermissionDenied Error CimException

I have an ansible script that contains a powershell script (win_shell) to make changes to DNS on a Windows Server. The powershell script is as follows:

Add-DnsServerResourceRecordPtr -Name “46.228.20” -PtrDomainName PVDIMCSM40.intra.bca.co.id -ZoneName “10.in-addr.arpa

This script is run by using a user I named ansidns which I have given the following permissions:

  1. Winrm configSDDL default: Read & Execute

  2. Computer management > WMI > Security
    Root > CIMV2 : Execute methods, enable account, remote enable
    Root > Microsoft > Windows > DNS : Execute methods, enable account, remote enable

  3. DNS Manager, in DNS Server zone: Read, Write, Create all child object

I give all the above permissions to descendant objects as well.

However, the following error appears after I run it:

Add-DnsServerResourceRecordPtr : Failed to create resource record 46.228.20 in zone 10.in
-addr.arpa on server KP1DOMDC06. At line:1 char:65 + [Console]::InputEncoding = New-Object
Text.UTF8Encoding $false; Add-DnsServer Res ... +
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +
CategoryInfo : PermissionDenied: (46.228.20:root/ Microsoft/...s ourceRecordPtr) [Add-
DnsServerResourceRecordPtr], CimException + FullyQualifiedErrorId : WIN32 5,Add-
DnsServerResourceRecordPtr

Does anyone have a solution to the above problem? What are the permissions I haven't added?

Thank you for the help

windows-serverwindows-server-powershellwindows-dhcp-dns
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

RichMatheisen-8856 avatar image
0 Votes"
RichMatheisen-8856 answered
  1. Are you running the script from an elevated PowerShell session (i.e. Run as administrator)?

  2. Are there any "Deny" permissions on the DNS zone? If there are, remove it/them.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.