473,761 Members | 7,351 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 16396

"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
21912
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
4221
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
6783
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
1309
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
21749
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
11854
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
12416
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
3239
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
5666
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
9522
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9336
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9902
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
8770
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
5215
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...
0
5364
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3866
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
3
3446
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2738
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.