Hello,
This script mays works but I mean it needs an external module (ADDnsPartition).
I found a script to solve my issue.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
I would like to change many owner dns record in order to replace it by their object name computer using powershell.
Please does someone can help me, or have any script which can do this?
Or allow full control the computer name object for their each dns record via powershell.
Thank you by advance.
Hello,
This script mays works but I mean it needs an external module (ADDnsPartition).
I found a script to solve my issue.
Are you trying to fix inconsistent permissions so dynamic DNS updates are allowed to be made by the computer account?
Here's one: Resolve-DdnsRecordPermissionProblem.ps1
Hello,
additional clarifying question would be if you are trying to remove from the DNS lists some current computer owner so you see the sid info as the current owner? And you like to replace it to computer_name.
Import-Module D:\Powershell\DNS\DnsShell
Import-Module ActiveDirectory
Add-PSSnapin Quest.ActiveRoles.ADManagement
$servers = get-content D:\Powershell\Scripts\DNSRECORDS.txt
$newarray = @()
foreach ($computer in $servers) {
Get-ADDnsPartition | Get-ADDnsRecord | Where-Object {$.Name -eq $Computer} | % {
$RecordName = $.Name
$RecordName = "GTLAW\$RecordName" + '$'
$RecordDN = (Get-ADObject –Identity $.ObjectGUID).DistinguishedName
$Owner = (Get-Acl -Path "ActiveDirectory:://RootDSE/$RecordDN").Owner
If ($Owner -eq "$RecordName") {
Write-Host 'Good |' $.Name '|' $Owner
} Else {
Write-Host 'Bad |' $.Name '|' $RecordName $Owner
$AdACL = get-ACL ("AD:\" + $RecordDN)
$ADobject = New-Object System.Security.Principal.NTAccount($.NAME + "$")
$sid = $ADobject.Translate([System.Security.Principal.SecurityIdentifier])
$AdACL.SetOwner($sid)
set-acl -path ("AD:\" + $RecordDN) -AclObject $AdACL
}
}
}
If the reply is helpful, please Upvote and Accept as answer