To make the page more portable, the "Refreshbtn_onclick" subroutine was replaced in our environment. Replacing this section will remove the dependency on having "smssend.vbs" in the %windir% folder.
Edit Machrest.asp (make a backup first), and find Sub Refreshbtn_onClick. Replace everything between Sub Refreshbtn_onClick and End Sub with this:
dim CompName,wShell,objPing,smsclient
CompName = trim(document.frmMain.txtValue.value)
if len(trim(CompName)) = 0 then
msgbox "Please type a Machine Name.",,"SMS Machine Policy"
else
Set WShell = CreateObject("WScript.Shell")
Set objPing = GetObject("winmgmts://" & ServerName & "/root/default:PingPoller")
objPing.Ping CompName, "100", "1", PingResult
if PingResult <> 0 then
msgbox "Machine did not respond to ping.",,"SMS Machine Policy"
wscript.quit
else
err.clear
Set smsClient = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
CompName & "\root\ccm:SMS_Client")
if err.number <> 0 then
msgbox "Unable to access " & CompName & vbcr &_
"Error: " & err.description,,"SMS Machine Policy"
wscript.quit
end if
smsClient.RequestMachinePolicy
smsclient.EvaluateMachinePolicy
msgbox "Executed Remote SMS Machine Policy Request.",,"SMS Machine Policy"
end if
end if
Alternative Edit (something the ping part doesn't work right for me):
dim CompName,wShell,objPing,smsclient
CompName = trim(document.frmMain.txtValue.value)
if len(trim(CompName)) = 0 then
msgbox "Please type a Machine Name.",,"SMS Machine Policy"
else
Set WShell = CreateObject("WScript.Shell")
err.clear
Set smsClient = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
CompName & "\root\ccm:SMS_Client")
if err.number <> 0 then
msgbox "Unable to access " & CompName & vbcr &_
"Error: " & err.description,,"SMS Machine Policy"
else
smsClient.RequestMachinePolicy
smsclient.EvaluateMachinePolicy
msgbox "Attempted to execute Remote SMS Machine Policy Request.",,"SMS Machine Policy"
end if
end if