GuidesUsing Netsh to Manage Remote Servers and Workstations

Using Netsh to Manage Remote Servers and Workstations

ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.

The network shell (Netsh) of Windows can be a great way to view or manage network-related settings via the Command Prompt. You can use it to run one-off commands or utilize scripts for some automation. And as we’ll discuss today, Netsh can also be used to manage remote workstations and servers.

Using the remote functionality of Netsh

The built-in remote functionality of Netsh allows you to send commands Windows Server Tutorials to individual machines on the network. You can specify a remote machine you’d like to run the command or script on by inserting the -r option. If necessary, you can also specify login credentials to use for the remote connection: -u for the username of the remote machine and -p for the password.

Open a Command Prompt and enter the following command to access the Netsh CLI on a remote machine:

netsh -r hostname -u domainadmin -p password

Once you’ve established that you can gain remote access, you can also run netsh commands directly. For instance, here’s how to obtain the IP configuration:

netsh -r hostname -u domainadmin -p password interface ip show config

For the -r option, you can also use the IP address or FQDN in addition to the host name of remote machines.

If you run into connectivity issues with remote machines, ensure the Remote Registry service is running on the remote computer. If it is not, then Windows may display a “Network Path Not Found” error message. Additionally, verify File and Printer Sharing for Microsoft Networks is enabled in the network connection properties of the remote machine. As always, ensure there aren’t any firewalls blocking the traffic.

If connectivity issues persist, try the following Registry edit:

  1. Open RegEdit on the remote machine and navigate to HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystem
  2. Add a new DWORD value called “LocalAccountTokenFilterPolicy,” if it doesn’t already exist, and ensure its value is set to “1”
  3. Reboot the remote machine.

Using Netsh via psexec

Netsh lacks an easy way to simultaneously manage multiple remote machines. Though you could get creative with the built-in remote functionality, like incorporating multiple remote addresses in batch files and other scripts, you might have better luck pursuing other options.

For instance, utilizing the PsExec utility from Windows Sysinternals allows you to push out Netsh (or any other commands) to multiple machines at once.

Once you download PsExec, open a Command Prompt to the folder containing it and try the following command to access the CLI of a remote machine:

psexec hostname -u domainadmin -p password cmd

If the remote machine is Windows Vista or higher, you may need to use the -h option to have the process run with the account’s elevated token.

Once you’ve established that you can gain remote access, you can also run netsh commands directly, for instance:

psexec hostname -u domainadmin -p password cmd.exe /c netsh.exe interface ip show config

If an interactive CLI isn’t needed — for example, if you’re running a command that doesn’t provide output — consider adding the psexec -d option. This option tells it not to wait for the process to terminate. On the other hand, if you’d like the program to be interactive on the desktop of the remote machine, consider the -i option.

Eric Geier is a freelance tech writer — keep up with his writings on Facebook. He’s also the founder of NoWiresSecurity, a cloud-based Wi-Fi security service, and On Spot Techs, an on-site computer services company.

Follow ServerWatch on Twitter and on Facebook

Featured Partners: RMM Software

Zoho Assist

Visit website

Strengthen your remote monitoring and management strategy with Zoho Assist's user-friendly interface and proactive solutions. With its robust features, Zoho Assist empowers administrators to monitor devices in real time, control them remotely, install updates, ensure security and compliance, and gain insights through comprehensive reporting.

Learn more about Zoho Assist

SuperOps.com RMM

Visit website

SuperOps.ai RMM

With SuperOps.ai’s RMM (Remote Monitoring and Management) you can manage your client’s network of assets with ease and proactively tackle issues. Monitor assets in real time, dive deep for granular information about an asset and find all the context you need to resolve issues effectively.

If you’d like to try the RMM out for yourself, you can sign up for a 21-day free trial to take it for a spin and see the solution in action. No strings attached.

Learn more about SuperOps.com RMM

Wrike

Visit website

Trusted by 20,000+ companies and over two million users, Wrike is a powerful remote monitoring and management software. Stay on track with Gantt charts, synced calendars, Kanban boards, time-tracking, real-time updates, and auto-assignment – all protected by enterprise-level security. Integrate Wrike with 400+ applications and Adobe Creative Cloud so you can keep using the tools you rely on every day. Customize your workflow and reduce the need for emails, meetings, check-ins, and more.

Learn more about Wrike

Site24x7

Visit website

Site24x7 provides a comprehensive solution for remote monitoring and management of diverse client environments, including endpoints, websites, networks, servers, applications, and cloud. Create customized dashboards, NOC views, and business views highlighting all the critical metrics.
With features like white-labeling, multi-tenancy, customizable roles and permissions, and detailed reports and service level agreements, Site24x7 helps you manage your customer accounts with ease.

Learn more about Site24x7

BDRSuite

Visit website

BDRSuite's MSP Backup Solution is designed for Cloud and managed Service Providers. Exclusive Pricing to maximize profit margins. No minimum monthly commitments, pay-as-you-go pricing, and bigger discounts for upfront payment. Centralized management through multi-tenancy support and license management portal. Co-branding available. 24/7 technical support. Dedicated account manager. Offer On-Premise, Remote & Hybrid Backup for VMs, Servers, Endpoints, SaaS and cloud.

Learn more about BDRSuite

Get the Free Newsletter!

Subscribe to Daily Tech Insider for top news, trends & analysis

Latest Posts

Related Stories