Get Default Gateway…Change Default Gateway

Sometimes, people change things. Sometimes people change subnets and default gateways and you aren’t allowed to inflict serious physical or emotional pain on them like a vengeful senior team member. You have to fix it. Actually that reminds of the time someone took ownership of all the GPO’s in an environment and gave himself the only permissions and everyone wondered why it all broke. And he screamed ‘Blamefest!’ at everyone when he got told off. Ah well, that’s what happens when you give full domain admin rights to an apprentice. But I digress!

Actually, changing default GW 2, The Search For A Script, came about because I was working on an environment where there was originally no internet, then some machines had a working GW, then other machines were given a different one and like many infrastructure related tasks I feel I may have to do again as part of process, I try and find a solution to automate or expedite for next time. So, with no further ado, I used these great links to Find the GW and Change the GW.

PSEXEC to Find:

Get Default GW

Powershell to Change:

Change GW

Disable Automatic Maintenance using PSEXEC

I had this exact same problem as the post describes. VM’s were laggy and cpu was at 100%, the culprit was “TiWorker.exe” , which is auto maintenance, not some nasty malware bug… But a ‘feature’ in Server 2012 and R2.

I went one stop further and added a command to use a text document which contained a list of server names, so I could disable on all the necessary servers – I’ll add that to the post if i find it:

Disable automatic maintenance with PSEXEC