Deploying DNS suffix to multiple machine.

hi there,

A little background.

i’m trying to deploy DNS suffix to multiple local servers (i’m working in an enterprise organisation) this testing environment is disconnected from the domain environment (we use AP configured as a DHCP and some swtiches).


My goal is to deploy to 60 servers the DNS suffix, instead of login to each one and manually doing it.

i successfully created a script to deploy it on one servers , the question is, what cmdlet i need to use in order to deploy this command to 60 servers.


here i the cmdlet i use:(i’m running the script locally on the server and it works)…

#Change adapter names:
Rename-NetAdapter -name “Ethernet 2” -NewName “Black”
Rename-NetAdapter -name “Ethernet” -NewName “Internal”

$netadapter = Get-NetAdapter -Name Black

#Change suffix list:
Set-DnsClientGlobalSetting -SuffixSearchList @(“” , “” , “” , “”)

Thank you for your support.

You should take a look at Invoke-Command. Read the help including the examples and you will have an idea how to run commands remotely.

There are plenty of sample script for this use case all over the web. Just use your post title to find them. Example:

Change DNS ip addressess remotely on multiple computers

Powershell: Change DNS ip addressess remotely on multiple computers

Risk Management Statement:
Never run any one else’s code unless you know exactly what it is doing, no matter who / where you get it from.
Initially only use sandboxed / test environments.