thread pool services

J

James

i wrote a windows service that runs thread pool. I have 2 xp pc and it
attempts to check on 2 pc Messenger service.

Pc1 where my vb service program is run.
pc2 .

When the thread goes to pc1 and if Messenger service is stopped, it will
attempt to start
When the thread goes to pc2 and if Messenger service is stopped, it will
not atttempt to start.

Does servicecontrollerstatus works on locally on machine that my vb service
is run, ie on pc 1 and cannot do remotely ie on pc 2 ?


On pc2, i check the security event log that pc1 has attempt to logon to
start the service, but ends up with "Failure audit".


any advice ?



=================
sercurity eventlog in pc2
=================

Object Open:
Object Server: SC Manager
Object Type: SERVICE OBJECT
Object Name: Messenger
Handle ID: -
Operation ID: {0,20496030}
Process ID: 736
Image File Name: C:\WINDOWS\system32\services.exe
Primary User Name: pc2$
Primary Domain: xxx
Primary Logon ID: (0x0,0x3E7)
Client User Name: pc1$
Client Domain: xxx
Client Logon ID: (0x0,0x13850A4)
Accesses: Start the service

Privileges: -
Restricted Sid Count: 0



=============================
'sample code
=============================

Dim svcstatus As System.ServiceProcess.ServiceControllerStatus

If svcstatus = ServiceControllerStatus.Stopped Then
Try
Me.m_svccontrol.Start()
m_wEvents.Source = servername & " Success"
m_wEvents.WriteEntry(servername & " started successfully.")
Catch ex As Exception
m_wEvents.Source = servername & " Fail"
m_wEvents.WriteEntry(servername & " was stopped.",
EventLogEntryType.Error)
Exit Sub
End Try
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top