This line
 Code:
$objReg = $GetObject("winmgmts:{impersonationLevel=impersonate}!\\" + $strComputer + "\root\default:StdRegProv")

should be
 Code:
$objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" + $strComputer + "\root\default:StdRegProv")


This line
 Code:
$strServerLocatorpoint = "$servername"

Should be
 Code:
$strServerLocatorpoint = "servername"

or
 Code:
$strServerLocatorpoint = $servername
If you assigned value to $servername

And this line
 Code:
$SMSService = objWMIService.ExecQuery("SELECT * FROM Win32_Service WHERE DisplayName = 'SMS Remote Control Agent' ")

should be
 Code:
$SMSService = $objWMIService.ExecQuery("SELECT * FROM Win32_Service WHERE DisplayName = 'SMS Remote Control Agent' ")


Also this line
 Code:
$objShell.LogEvent EVENT_SUCCESS, $strSMSLogText

should be
 Code:
$objShell.LogEvent($EVENT_SUCCESS, $strSMSLogText)


In any case my translated script should work fine, if it doesn't then either the original VBS that you supplied here didn't work, or it isn't the original vbs that you started out with in the first place.


Edited by apronk (2007-02-13 05:26 PM)