473,714 Members | 2,527 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HowTo start/stop a service on a remote computer

Hi all!
I'm still trying to start/stop a service on a remote computer. (I
promiss that's the last new post because of this problem from my side)

My situation:
I've an application running under the user paul (pw:paul123) on the
computer A in the domain ABC. This application should stop / start a
service, which is running on computer B (in workgroup ABCWG (NOT IN
DOMAIN ABC)). On the computer B I have a user administrator (pw:
adminTest) and a user TestUser (pw: testuser). Both of this user does
not exist in domain ABC

I tried to get the user credentials of a user on computer B by using
LogonUser. I tried this with both users on computer B, but it does not
work. If I rename the TestUser into paul on computer B I get an error
message, but I also get the access token.

Code and better description of this problem could be seen in:
http://groups.google.ch/group/micros...e31c968f8d92ab

So now I'm not shure, if I'm on the right way to start/stop a service
on a remote computer. If this is the right way, which requirements must
be fulfilled ?

Thanks and regards
Marcel Hug

Jun 27 '06 #1
1 16388

"schaf" <sc***@2wire.ch > wrote in message
news:11******** **************@ x69g2000cwx.goo glegroups.com.. .
| Hi all!
| I'm still trying to start/stop a service on a remote computer. (I
| promiss that's the last new post because of this problem from my side)
|
| My situation:
| I've an application running under the user paul (pw:paul123) on the
| computer A in the domain ABC. This application should stop / start a
| service, which is running on computer B (in workgroup ABCWG (NOT IN
| DOMAIN ABC)). On the computer B I have a user administrator (pw:
| adminTest) and a user TestUser (pw: testuser). Both of this user does
| not exist in domain ABC
|

Use the right tools for this, that is System.Manageme nt and WMI, no need for
LogonUser and impersonation stuff.
| I tried to get the user credentials of a user on computer B by using
| LogonUser. I tried this with both users on computer B, but it does not
| work. If I rename the TestUser into paul on computer B I get an error
| message, but I also get the access token.
|

I don't get it really, if LogonUser fails you can't possibly get an access
token.

| Code and better description of this problem could be seen in:
|
http://groups.google.ch/group/micros...e31c968f8d92ab
|

This is only a part of the code, not usable anyway.

| So now I'm not shure, if I'm on the right way to start/stop a service
| on a remote computer. If this is the right way, which requirements must
| be fulfilled ?
|

What happens if you first establish a network session with the remote server
(using net use \\... /user:....) and after that, try to stop/start a service
remotely using the services applet?

Note that you should delete the network session before you try again using
LogonUser/Impersonate, else you will use the established session to access
the remote resource instead of the access token obtained (or not) by
LogonUser.

Willy.


Jun 27 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
21909
by: Mark | last post by:
I created an extremely simple windows service that only writes to the EventLogs on Stop and Pause. I installed it using the InstallUtil.exe program, the output of which is below. It appears to be successful. I'm now ready to start my service (I think) but the NET START command does not appear to indicate that the service is available to be run. The output for NET START is below as well. The Services list in the W2K administrator...
16
4212
by: Serdar Kalaycý | last post by:
Hi everybody, My problem seems a bit clichè but I could not work around. Well I read lots of MSDN papers and discussions, but my problem is a bit different from them. When I tried to run the project in debug mode (by hitting F5) it gives an error message "Error while trying to run project: Unable to start debugging on the web server.
2
6772
by: Chris Dunaway | last post by:
I need to be able to start and stop a service on another computer on the network. But I cannot connect to the other computer using my standard user credentials. I have a separate login for that for which I use Remote Desktop to connect to the other machine. The other machine is a test server where my Windows Service application is running. It is an inconvenience to have to connect through Remote Desktop just to start and stop the...
0
1302
by: louise.kelly | last post by:
Hi All, Looking for a bit of help here. I have a VB.NET application that runs as a service on a W2003 Server, well that sometimes runs as a service. If I start the service while connected to the server via remote desktop, the service starts successfully and all is hunky dory. However, if I logon directly to the server as the same user, I get the message:
4
21739
by: carson | last post by:
I have written two windows services: - service A does some crunching of local data files and uploads them to a central processing computer via http. - service B monitors a manifest file on a webserver to see if service A needs to be updated. What service B does if it sees their is an update for service A is to download a new copy of the service A executable, stop service A, replace the executable with the new copy, and start service B...
3
11851
by: Goran Djuranovic | last post by:
Hi all, I have a web app running on a local PC that can start and stop windows service on a remote machine, but only when I browse to it locally. If I browse to it from my other PC and try to start/stop the service, it gives me "Cannot open Service Control Manager on computer 'xxx.xxx.xxx.xxx'. This operation might require other privileges." error. Helpfull info: - I am an admin on all 3 PCs - web app is using "Windows" authentication...
3
12412
by: kneidels | last post by:
Hey folks on XPP here. I have always had IIs started by default, but suddenly now i see my default (and only) website is off. i get this message when trying to start it - running iisreset via Run > CMD gives me the following:
4
3235
Wing
by: Wing | last post by:
Hello fellow programmers. I am writing a desktop application that will allow our IT department to execute commands on remote computers. I had originally found a post that has a two part program that was working nicely for half our computers. It seems that when the remote portion (which is a service) is running other programs will get hung up. We have to go into Services and Stop the service. Once this is done, all other programs execute...
1
5661
by: aj | last post by:
A few service stop/start/restart questions on SQL Server 2005 SP2, which I'll call SQLS. It looks as if there are *potentially* 6 ways to start/stop SQLS Services like the engine itself, integration services, reporting service, Agent.. -SQLS Configuration Manager -SQLS Surface Area Configuration (for Services and Connections) -Mgmt Studio Local (on server)
0
9307
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9071
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9009
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7946
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5943
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4462
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3155
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2514
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2105
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.