Monday, December 13, 2021

Updating DNS servers via command line

Problem: Updating DNS to a static address on a subset of users.
No VLANs
No network segmentation
Basically, can't be done via DHCP due to hardware and previous configuration limitations.

Using CMD, the DNS servers can be changed from DHCP to Static, if you have a remote tool (LogMeIn, Splashtop, etc) that can connect to the computers and run CMD line instructions, this could help. WMIC node: or powershell may allow you to run the same if your environment is compatible.

Find the name of the interface:

netsh interface ipv4 show config

Also, ipconfig/all will work

Update DNS to static:

netsh interface ipv4 set dns name="(InterfaceName)" static 1.1.1.1

Add second DNS server:

netsh interface ipv4 add dnsserver "(InterfaceName)" address=8.8.8.8

Pulling local admin accounts on a windows system WITH POWERSHELL

 There’s a couple ways to get them, I’m sure you’ve been around the internet looking. The Powershell scripts I use: Get-LocalGroupMember -Gr...