Windows network configuration changes for automation

Random 0 Reputation points
2025-05-27T06:44:26.5333333+00:00

Hi

We're using Windows on manufacturing testing machines. For testing our Device Under Test DUTs I need to do changes on network interface adapters as for example deactivating them.
As our test systems are fully automated we also need to automate those changes as for example using the following command to deactivate a network interface:

netsh interface set interface "Ethernet 6" admin=disabled

The problem is that this command only works if I run CMD as an administrator what we don't want. Because this way every time the command gets executed the user would need to enter the admin credentials.
Unfortunately so far I could not find any way how we can automate network configuration changes via cli without administrator rights.

What i tried so far:

Does anyone else have this issue and how could you solve it?
Many thanks in advance for suggestions.

Best regards

Windows for business Windows Client for IT Pros Networking Network connectivity and file sharing
{count} votes

1 answer

Sort by: Most helpful
  1. MR_MEOW 76 Reputation points
    2025-05-30T15:37:53.23+00:00

    Hello.

    [ Answer 1 ]

    I think that if you are located in person and executing this command on the computer/machine. I would think that a physical device would be less hassle. I do recall paying with one of these retro printer switches when I was a kid they have them for rj45 connections as well.

    [ Answer 2 ]

    Also You could turn on/off the network through the router by entering into the ISP modem/router settings and blocking the mac address temporally

    [ Answer 3 ]

    You can change the UAC level to low to turn off the prompt completely

    User's image


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.