In my project I want to execute some commands on the remote machine. I
am using .Net Remoting to achieve this. My server which is an exe is
copied on the remote machine and it receives command from client which
is executed by the exe. I am facing problem while executing the exe on
the remote machine. If I start the exe manually everything works fine
but if I execute it remotely through code using WMI an exception is
thrown saying "No connection could be made because the target machine
actively refused it". This exception is generally thrown when the remote
server is not running but the task manager of the remote machine shows
that the exe is running. I am using Win32_process class to do this. The
MSDN help of Win32_process class Create() method says "For security
reasons the Win32_Process.Create method cannot be used to start an
interactive process". Is this the reason for the exception? If so, then
what is the alternative for executing an exe on remote machine?
I am pasting the code snippet of my client and server below
Code of Server:
RemotingConfiguration.Configure( "rpcserver.exe.config" );
TcpServerChannel channel = new TcpServerChannel(rs.mPort);
ChannelServices.RegisterChannel(channel);
RemotingConfiguration.RegisterWellKnownServiceType (
typeof(RemoteServerObject),
"ToolCommand",
WellKnownObjectMode.SingleCall);
Code for Client:
ManagementScope obScope = new ManagementScope("\\\\" + remoteServer +
"\\root\\CIMV2");
ManagementClass shareClass = new ManagementClass( "\\\\" + remoteServer
+ "\\root\\CIMV2:Win32_Process" );
object[] param = {"c:\\temp\\rpcserver.exe",null,null,null};
object response = shareClass.InvokeMethod( "Create", param );
} 5 6237
Are you configurating the executable before you launch it?
I don't know anything about WMI, but I've used remoting a fair bit. As you say, if the server isn't running, then you get the error message. Are you trying to start up and shut down a remoting exe at will, or just run it?
Martin.
"Data" wrote: In my project I want to execute some commands on the remote machine. I am using .Net Remoting to achieve this. My server which is an exe is copied on the remote machine and it receives command from client which is executed by the exe. I am facing problem while executing the exe on the remote machine. If I start the exe manually everything works fine but if I execute it remotely through code using WMI an exception is thrown saying "No connection could be made because the target machine actively refused it". This exception is generally thrown when the remote server is not running but the task manager of the remote machine shows that the exe is running. I am using Win32_process class to do this. The MSDN help of Win32_process class Create() method says "For security reasons the Win32_Process.Create method cannot be used to start an interactive process". Is this the reason for the exception? If so, then what is the alternative for executing an exe on remote machine?
I am pasting the code snippet of my client and server below
Code of Server:
RemotingConfiguration.Configure( "rpcserver.exe.config" ); TcpServerChannel channel = new TcpServerChannel(rs.mPort); ChannelServices.RegisterChannel(channel); RemotingConfiguration.RegisterWellKnownServiceType ( typeof(RemoteServerObject), "ToolCommand", WellKnownObjectMode.SingleCall);
Code for Client:
ManagementScope obScope = new ManagementScope("\\\\" + remoteServer + "\\root\\CIMV2"); ManagementClass shareClass = new ManagementClass( "\\\\" + remoteServer + "\\root\\CIMV2:Win32_Process" ); object[] param = {"c:\\temp\\rpcserver.exe",null,null,null}; object response = shareClass.InvokeMethod( "Create", param ); }
Hi
I want to start and stop the exe at will. When I start the exe manually
everything works fine. If I executed it through code using WMI I get this
error. R there any other ways other than WMI to execute an exe on the
remoted machine?
Thanks
"Martin Platt" <Ma*********@discussions.microsoft.com> wrote in message
news:47**********************************@microsof t.com... Are you configurating the executable before you launch it?
I don't know anything about WMI, but I've used remoting a fair bit. As
you say, if the server isn't running, then you get the error message. Are
you trying to start up and shut down a remoting exe at will, or just run it?
Martin.
"Data" wrote:
In my project I want to execute some commands on the remote machine. I am using .Net Remoting to achieve this. My server which is an exe is copied on the remote machine and it receives command from client which is executed by the exe. I am facing problem while executing the exe on the remote machine. If I start the exe manually everything works fine but if I execute it remotely through code using WMI an exception is thrown saying "No connection could be made because the target machine actively refused it". This exception is generally thrown when the remote server is not running but the task manager of the remote machine shows that the exe is running. I am using Win32_process class to do this. The MSDN help of Win32_process class Create() method says "For security reasons the Win32_Process.Create method cannot be used to start an interactive process". Is this the reason for the exception? If so, then what is the alternative for executing an exe on remote machine?
I am pasting the code snippet of my client and server below
Code of Server:
RemotingConfiguration.Configure( "rpcserver.exe.config" ); TcpServerChannel channel = new TcpServerChannel(rs.mPort); ChannelServices.RegisterChannel(channel); RemotingConfiguration.RegisterWellKnownServiceType ( typeof(RemoteServerObject), "ToolCommand", WellKnownObjectMode.SingleCall);
Code for Client:
ManagementScope obScope = new ManagementScope("\\\\" + remoteServer + "\\root\\CIMV2"); ManagementClass shareClass = new ManagementClass( "\\\\" + remoteServer + "\\root\\CIMV2:Win32_Process" ); object[] param = {"c:\\temp\\rpcserver.exe",null,null,null}; object response = shareClass.InvokeMethod( "Create", param ); }
Hi,
why you not host your server in windows service, and remotely start/stop
the service?
Sunny
In article <uo*************@TK2MSFTNGP12.phx.gbl>, go***********@yahoo.com says... Hi
I want to start and stop the exe at will. When I start the exe manually everything works fine. If I executed it through code using WMI I get this error. R there any other ways other than WMI to execute an exe on the remoted machine?
Thanks
"Martin Platt" <Ma*********@discussions.microsoft.com> wrote in message news:47**********************************@microsof t.com... Are you configurating the executable before you launch it?
I don't know anything about WMI, but I've used remoting a fair bit. As you say, if the server isn't running, then you get the error message. Are you trying to start up and shut down a remoting exe at will, or just run it?
Martin.
"Data" wrote:
In my project I want to execute some commands on the remote machine. I am using .Net Remoting to achieve this. My server which is an exe is copied on the remote machine and it receives command from client which is executed by the exe. I am facing problem while executing the exe on the remote machine. If I start the exe manually everything works fine but if I execute it remotely through code using WMI an exception is thrown saying "No connection could be made because the target machine actively refused it". This exception is generally thrown when the remote server is not running but the task manager of the remote machine shows that the exe is running. I am using Win32_process class to do this. The MSDN help of Win32_process class Create() method says "For security reasons the Win32_Process.Create method cannot be used to start an interactive process". Is this the reason for the exception? If so, then what is the alternative for executing an exe on remote machine?
I am pasting the code snippet of my client and server below
Code of Server:
RemotingConfiguration.Configure( "rpcserver.exe.config" ); TcpServerChannel channel = new TcpServerChannel(rs.mPort); ChannelServices.RegisterChannel(channel); RemotingConfiguration.RegisterWellKnownServiceType ( typeof(RemoteServerObject), "ToolCommand", WellKnownObjectMode.SingleCall);
Code for Client:
ManagementScope obScope = new ManagementScope("\\\\" + remoteServer + "\\root\\CIMV2"); ManagementClass shareClass = new ManagementClass( "\\\\" + remoteServer + "\\root\\CIMV2:Win32_Process" ); object[] param = {"c:\\temp\\rpcserver.exe",null,null,null}; object response = shareClass.InvokeMethod( "Create", param ); }
"Data"
I agree with what sunny is saying - see parallel posting.
I think by choosing the implementation you are, you're making it hard for yourself.
If you're remoting, and you have the two servers in there, you can also set properties in your executable as it is at the moment, so that it appears to unload, or actually to unload it.
I think you need to consider your design decisions, and question whether there are better, more dependable ways to achieve what you want to achieve....
By all means reveal there what where and why of your design, and we can try to help you?
Cheers,
Martin.
"Data" wrote: Hi
I want to start and stop the exe at will. When I start the exe manually everything works fine. If I executed it through code using WMI I get this error. R there any other ways other than WMI to execute an exe on the remoted machine?
Thanks
"Martin Platt" <Ma*********@discussions.microsoft.com> wrote in message news:47**********************************@microsof t.com... Are you configurating the executable before you launch it?
I don't know anything about WMI, but I've used remoting a fair bit. As you say, if the server isn't running, then you get the error message. Are you trying to start up and shut down a remoting exe at will, or just run it?
Martin.
"Data" wrote:
In my project I want to execute some commands on the remote machine. I am using .Net Remoting to achieve this. My server which is an exe is copied on the remote machine and it receives command from client which is executed by the exe. I am facing problem while executing the exe on the remote machine. If I start the exe manually everything works fine but if I execute it remotely through code using WMI an exception is thrown saying "No connection could be made because the target machine actively refused it". This exception is generally thrown when the remote server is not running but the task manager of the remote machine shows that the exe is running. I am using Win32_process class to do this. The MSDN help of Win32_process class Create() method says "For security reasons the Win32_Process.Create method cannot be used to start an interactive process". Is this the reason for the exception? If so, then what is the alternative for executing an exe on remote machine?
I am pasting the code snippet of my client and server below
Code of Server:
RemotingConfiguration.Configure( "rpcserver.exe.config" ); TcpServerChannel channel = new TcpServerChannel(rs.mPort); ChannelServices.RegisterChannel(channel); RemotingConfiguration.RegisterWellKnownServiceType ( typeof(RemoteServerObject), "ToolCommand", WellKnownObjectMode.SingleCall);
Code for Client:
ManagementScope obScope = new ManagementScope("\\\\" + remoteServer + "\\root\\CIMV2"); ManagementClass shareClass = new ManagementClass( "\\\\" + remoteServer + "\\root\\CIMV2:Win32_Process" ); object[] param = {"c:\\temp\\rpcserver.exe",null,null,null}; object response = shareClass.InvokeMethod( "Create", param ); }
Hi Everyone
I found the bug in my code and the problem as been
fixed. Now I am facing new problem. My server is running fine but while
doing a certain task it throws following exception:
System.Security.SecurityException: Request for principal permission failed
what are the possible causes of the exception? and what r the resolutions?
Thanks for your help
Data
"Martin Platt" <Ma*********@discussions.microsoft.com> wrote in message
news:9D**********************************@microsof t.com... "Data"
I agree with what sunny is saying - see parallel posting. I think by choosing the implementation you are, you're making it hard for
yourself. If you're remoting, and you have the two servers in there, you can also
set properties in your executable as it is at the moment, so that it appears
to unload, or actually to unload it. I think you need to consider your design decisions, and question whether
there are better, more dependable ways to achieve what you want to
achieve.... By all means reveal there what where and why of your design, and we can
try to help you? Cheers,
Martin.
"Data" wrote:
Hi
I want to start and stop the exe at will. When I start the exe manually everything works fine. If I executed it through code using WMI I get
this error. R there any other ways other than WMI to execute an exe on the remoted machine?
Thanks
"Martin Platt" <Ma*********@discussions.microsoft.com> wrote in message news:47**********************************@microsof t.com... Are you configurating the executable before you launch it?
I don't know anything about WMI, but I've used remoting a fair bit.
As you say, if the server isn't running, then you get the error message.
Are you trying to start up and shut down a remoting exe at will, or just run
it?
Martin.
"Data" wrote:
> In my project I want to execute some commands on the remote machine.
I > am using .Net Remoting to achieve this. My server which is an exe is > copied on the remote machine and it receives command from client
which > is executed by the exe. I am facing problem while executing the exe
on > the remote machine. If I start the exe manually everything works
fine > but if I execute it remotely through code using WMI an exception is > thrown saying "No connection could be made because the target
machine > actively refused it". This exception is generally thrown when the
remote > server is not running but the task manager of the remote machine
shows > that the exe is running. I am using Win32_process class to do this.
The > MSDN help of Win32_process class Create() method says "For security > reasons the Win32_Process.Create method cannot be used to start an > interactive process". Is this the reason for the exception? If so,
then > what is the alternative for executing an exe on remote machine? > > I am pasting the code snippet of my client and server below > > Code of Server: > > RemotingConfiguration.Configure( "rpcserver.exe.config" ); > TcpServerChannel channel = new TcpServerChannel(rs.mPort); > ChannelServices.RegisterChannel(channel); > RemotingConfiguration.RegisterWellKnownServiceType ( > typeof(RemoteServerObject), > "ToolCommand", > WellKnownObjectMode.SingleCall); > > > Code for Client: > > ManagementScope obScope = new ManagementScope("\\\\" + remoteServer
+ > "\\root\\CIMV2"); > ManagementClass shareClass = new ManagementClass( "\\\\" +
remoteServer > + "\\root\\CIMV2:Win32_Process" ); > object[] param = {"c:\\temp\\rpcserver.exe",null,null,null}; > object response = shareClass.InvokeMethod( "Create", param ); > } > > > This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Karuppasamy |
last post by:
H
I have created a Windows Application using C#. This Windows application makes a call to a Remoting Object which runs as a Windows Service. This Remoting Component makes a call to a Com+(Name :...
|
by: MS |
last post by:
In my project I want to execute some commands on the remote machine. I am
using .Net Remoting to achieve this. My server which is an exe is copied on
the remote machine and it receives command from...
|
by: Maurice |
last post by:
Our product is build using the .NET framework 1.1.
We have WinForm application that communicates a server via Remoting (tcp
channel).
We have two ways communication:
From application to...
|
by: bettervssremoting |
last post by:
To view the full article, please visit
http://www.BetterVssRemoting.com
Better VSS Remote Access Tool including SourceOffSite, SourceAnyWhere
and VSS Remoting
This article makes a detailed...
|
by: Data |
last post by:
In my project I want to execute some commands on the remote machine. I am
using .Net Remoting to achieve this. My server which is an exe is copied on
the remote machine and it receives command from...
|
by: Ryan H |
last post by:
Hi,
My data access layer for my VB.NET 1.1 application resides on a different
server and is accessed via Remoting.
Is there a way to configure my data access layer so that I can use...
|
by: Derrick |
last post by:
Hello all;
I'm having a bit of trouble with .NET remoting. Here's my scenario:
I have a "remotable" type which is served by a Windows Service. I
have a WinForms app which consumes the...
|
by: Wimpie van Lingen |
last post by:
Hey
I have some more questions with regards to Remoting in .NET 2. I'm using TCP with the Binary formatter.
My solution consists of 4 projects:
- Class Library containing the server classes...
|
by: Adhal |
last post by:
Hi,
I am using remoting to pass in parameters from new launches of an application. So basically I have
only one instance of the application and I am using remoting to pass the parameters.
...
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: Aliciasmith |
last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
|
by: NeoPa |
last post by:
Hello everyone.
I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report).
I know it can be done by selecting :...
|
by: Teri B |
last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course.
0ne-to-many. One course many roles.
Then I created a report based on the Course form and...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM)
Please note that the UK and Europe revert to winter time on...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
|
by: isladogs |
last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, Mike...
|
by: GKJR |
last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
| |