Fixing the Remote Control Ping button issue for Ron’s Web Tools
There has been an on going issue with the SMS Web console that has existed since the page was created back in 2004.
For some reason certain machines would report back that they did not respond to a ping even though the ping function was working when you clicked the Start Remote Control button. This would cause the button to fail and would not allow the tech to use remote control.
This was a flaw is the DLL pollprov.dll provided by Microsoft for SMS 2.0 (I think) and was never fixed in newer versions, at the time I did not know enough about VBscripting to fix the issue and since it was intermittent everybody in the SMS community let it slide (including myself).
I finally figured out another way to get the needed information to make the button work properly so,
I have completely re-written the code for the button so that it no longer uses the faulty DLL.
Users will no logger get the message :

They will now get this message instead:

Note: The button works faster then before if the machine is turned on but it may take a few seconds longer to timeout and give the error message if the machine doesn’t respond.
Note: this same code can be used for SCCM 2007. I will post another blog for that code as well.
Below is a copy of the old code and the new code.
'************************
' Remote Control Button *
'************************
'Old Code
'Sub Btnl_OnClick
' Dim CompName,oWshShell
' CompName = trim(document.frmMain.txtValue.value)
' if Len(Trim(CompName)) = 0 then
' MsgBox "Please type a Machine Name.",,"SMS 2003 Remote Control"
' Else
' Set oWshShell = CreateObject("WScript.Shell")
' 'You will need to edit the following line to fit your environment. SMSServer = Your SMS Server Name
' Set objPing = GetObject("winmgmts://oasms02/root/default:PingPoller")
' 'You will need To edit the following line to fit your environment. SMSServer = Your SMS Server Name
' path = "\\{SMSServerName}\remote$\remote.exe"
' objPing.Trace CompName, "30", "1000", "1", TraceResult, Addresses
' if TraceResult <> 0 then
' MsgBox "Machine did not respond to ping.",,"SMS 2003 Remote Control"
' Else
' 'You will need to edit the following line to fit your environment. SMSServer = Your SMS Server Name
' oWshShell.run path & " 2 " & addresses(ubound(addresses)) & " \\{SMSServerName}\",0,false
' end If
' end If
'End Sub
‘*************************************************************
' New Code written by Chris Stauffer to overcome the ping Failure issue *
‘*************************************************************
Sub Btnl_OnClick
'You will need to edit the following line to fit your environment. SMSServer = Your SMS Server Name
On Error Resume Next
Dim CompName,oWshShell
CompName = trim(document.frmMain.txtValue.value)
path = "\\{SMSServername}\remote$\remote.exe"
if Len(Trim(CompName)) = 0 then
MsgBox "Please type a Machine Name.",,"SMS 2003 Remote Control"
Else
Set oWshShell = CreateObject("WScript.Shell")
set IPConfigSet = GetObject("winmgmts:{impersonationLevel=impersonate}!//"& CompName &"").ExecQuery("select IPAddress from
Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
If Err.Number <> 0 Then
MsgBox "Machine Not Found on the network, Please check the name and try again.", 48,"SMS 2003 Remote Control"
Err.Clear
Else
for each IPConfig in IPConfigSet
if Not IsNull(IPConfig.IPAddress) then
for i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)
StrIP= IPConfig.IPAddress(i)
'MsgBox "Machine's IPAddress: " & StrIP
Next
End If
next
oWshShell.run path & " 2 " & StrIP & " \\{SMSServerName}\",0,false
End If
end If
End Sub
**************************************************************************************************