Verify and reset SRV record

Introduction

This script can be used to verify and reset SRV record on domain controller.

Scenarios

IT Administrators may need to check whether the SRV record is problematic, when DC locator cannot works.

Script

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.

PowerShell
Edit|Remove
if (Test-Path$NetlogonDNSFile) 
        { 
            $SRVRecordGet-Content$NetlogonDNSFile|?{$_-match "IN SRV"} 
            Write-Host "########## SRV record ##########"$SRVRecord 
        }

Examples

Example 01How to verify SRV record.

To verify SRV record, run the following command:

                .\SRVrecord.ps1

Example 02How to reset SRV record.

To reset SRV record, run the following command:

.\SRVrecord.ps1 -Reset

Additional Resources

Technical Resources:

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