Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8639095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:54:43+00:00 2026-06-12T10:54:43+00:00

please help me as i need to kill/ restart a process remotely. I have

  • 0

please help me as i need to kill/ restart a process remotely.

I have tried this but no luck for me. Error was – “Couldn’t connect to remote machine”

Process[] prs = Process.GetProcesses("SERVERNAME");

   foreach (Process pr in prs)
    {
       if (pr.ProcessName == "process")
       {
           pr.Kill();
       }
    }

I also try this one but still doesn’t work and got this error:
“Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))”

ManagementScope scope = new ManagementScope("\\\\SERVERNAME\\root\\cimv2");
scope.Connect();
ObjectQuery query = new ObjectQuery("SELECT * FROM Win32_Process WHERE Name='process'");
ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query);
ManagementObjectCollection objectCollection = searcher.Get();

   foreach (ManagementObject managementObject in objectCollection)
      {
       managementObject.InvokeMethod("Terminate", null);
      }

I hope someone has a solution for this.Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:54:45+00:00Added an answer on June 12, 2026 at 10:54 am

    Well, the errors are actually telling you exactly what’s wrong. Your application is failed connecting to the remote machine. This can happen for some reasons:

    1. The remote computer is unavailable (not exists)
    2. The remote computer doesn’t have WMI open for remote connection, or it’s firewall-ed on the remote machine or on the way.
    3. You don’t have a permission to perform this action. Since i don’t see anywhere in your code impersonation, then the connection will be using the current process token (which account it is? depends on your configuration on the application pool, or in your web.config if you use tag, by default – it’s NT AUTHORITY). You probably don’t have permissions to access the remote machine using WMI with the credentials you’re running at. It can be solved by impersonation in your code, in the web.config, or in the application pool settings to an account which has the sufficient permission (if you’re in domain, ask your IT department for an account).

    Good luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please i need help, this code below works fine on my localhost, php5.3+ but
Possible Duplicate: How does this CSS triangle shape work? Please help me i need
Please help! I need to produce a Crystal Report with multiple data columns, but
I need to convert the function path::combine(path1, path2). Please help me if you have
I need help. I have 6 tabs on website. But when i`m clicking to
I am trying to figure out how to structure this please help: I need
I'm low level as3 programmer and I need help whit this code: I have
Please help me to improve the following script: http://jsfiddle.net/n9BkM/8/ I need the following fucntionality:
Please help to the newbie in WPF! I need to build a TreeView with
Please, I need help with my code: def start(): def start_tkinter(): global main,l main.destroy()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.