Hi - In response to help from a couple of guys in the firums here I managed to create a UDF to stop services on a remote server.

Code:

FUNCTION STOPSERVICES($SVR, $Service)
$AD=GetObject("WinNT://"+$SVR+",computer")
$AD1= $AD.GetObject("Service",$service)
$SVCSTAT = $AD1.Status
IF $SVCSTAT <> 1
$STOPIT = $AD1.Stop
$SVCSTAT = $AD1.Status
ENDIF
ENDFUNCTION




Similarly the start() function:

Code:

FUNCTION STARTSERVICES($SVR, $Service)
$AD=GetObject("WinNT://"+$SVR+",computer")
$AD1= $AD.GetObject("Service",$service)
$SVCSTAT = $AD1.Status
IF $SVCSTAT <> 4
$STOPIT = $AD1.Start
$SVCSTAT = $AD1.Status
ENDIF
ENDFUNCTION



Edited by Brant_Winter (2005-05-09 04:18 AM)