If you read fADSIServiceRun, you will see that it can connect to a remote computer and then uses the "status" method to get the current current state of the service. below is a code segment from the UDF which you can tune to your own needs.

Code:

$objService = Getobject("WinNT://$Computer/$Service,Service")
if @error = 0
$status = $objService.status
select
case $status = 4 ;Running
; do something
case $status = 1 ;Stopped
; do something
case $status = 7 ;Paused
; do something
case 1
? "Unhandled service status(0):$status"
exit (1)
endselect
endif

_________________________
Home page: http://www.kixhelp.com/hb/