How do I get the DNS server cmdlets to work on PowerShell in Windows 10?

You can use implicit remoting as well, to temporarily import remote commands without installing RSAT:

$session = new-pssession -ComputerName server
Invoke-Command -command {Import-Module dnsserver} -Session $session
Import-PSSession -Session $session -Module dnsserver -Prefix RemoteDNS

The prefix will tag the imported commands so you can keep track of the remote commands. Once you import the commands, you run them by using the prefix prior to the noun.

For example:

Get-RemoteDNSdnsserverresourcerecord instead of get-dnsserverresourcerecord

The prefix is optional, however.


If you are using a non-server OS like Windows 10, you can add a bunch of Remote Server Admin Tools (RSAT) as an optional feature.

Starting with Windows 10 October 2018 Update, RSAT is included as a set of "Features on Demand" right from Windows 10. Go to "Manage optional features" in Settings and click "Add a feature" to see the list of available RSAT tools. Select and install the RSAT: DNS Server Tools feature.

Only if you're on an older version of Windows: see the instructions here and install the package https://www.microsoft.com/en-us/download/details.aspx?id=45520

The *-dnsserver* cmdlets will immediately start working in PowerShell after that package is installed on the local machine.