Access Sql server Agent Windows service on remote machine

  • which user have you logged on as on the other machine. Access denied is the key message here

    Your code really wants to be expanded as you are only checking for stopped or running, there are other states that could be set which would cause the code to fail. Check out the C# ServiceController class for more info

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • I am able to create object of 'ManagedComputer' on local as no need to 'user name' and 'passward'.

    Using sql server VS 2005. I can connect to database on different machine.

    but When I try to create service object

    i.e.

    ManagedComputer mc = default(ManagedComputer);

    mc = new ManagedComputer("RemoteMAchineName", "Login","Passward");

    Service svc = default(Service);

    svc = mc.Services["SQLSERVERAGENT"]; <--- Error

    I am not user which user name and password it takes or is there any other way.

Viewing 2 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply