This script can be used to verify and reset SRV record on domain controller.
IT Administrators may need to check whether the SRV record is problematic, when DC locator cannot works.
This script has only one parameter:
Reset: Script will reset SRV record, if specified.
How to run script:
1. Open Powershell in a domain controller, with “Run as Administrator” mode.
2. Switch to the path, where you download the script.
3. Run the script as example command below.
Here are some code snippets for your references. To get the complete script sample, please click the download button at the beginning of this page.
if (Test-Path $NetlogonDNSFile)
{
$SRVRecord= Get-Content $NetlogonDNSFile|?{$_ -match "IN SRV"}
Write-Host "########## SRV record ##########"
$SRVRecord
}
if (Test-Path$NetlogonDNSFile) { $SRVRecord= Get-Content$NetlogonDNSFile|?{$_-match "IN SRV"} Write-Host "########## SRV record ##########"$SRVRecord }
Example 01: How to verify SRV record.
To verify SRV record, run the following command:
.\SRVrecord.ps1

Example 02: How to reset SRV record.
To reset SRV record, run the following command:
.\SRVrecord.ps1 -Reset

Technical Resources:
How to verify that SRV DNS records have been created for a domain controller