Chris Stauffer at myITForum.com

You want me to do What?

ConfigMgr 2007 Replacement Remote control button For Ron's Web Console

 

On Ron's web console we had an issue since we have a mix of 2kpro and XP machines.This replacement code for the Remote control button will check to see what version the OS is on the system that you want to remote into then use the appropriate executable for the OS. Just replace the old code in the Machrest.asp file with this code 

 

 

'************************

' Remote Control Button *

'************************

' Original 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.",,"SCCM 2007 Remote Control"

'             Else

'                         Set oWshShell = CreateObject("WScript.Shell")

'                         path = "\\OASCCM01\remote$\rc.exe"

'                               oWshShell.run path & " 1 " & CompName & " \\OASCCM01\"

'             End If

' End Sub

 

'New Code

 

Sub Btnl_OnClick

            On error resume Next

            Dim CompName,oWshShell

            CompName = Trim(document.frmMain.txtValue.value)

            If len(Trim(CompName)) = 0 Then

                        MsgBox "Please type a Machine Name.",,"SCCM 2007 Remote Control"

            Else

                        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.",,"Current Loggod on User"

                        Else     

                                    Set objSWbemServices = GetObject("winmgmts:\\" & CompName & "\root\cimv2")

                                    err.clear

                                    Set colSWbemObjectSet = objSWbemServices.ExecQuery("Select * FROM Win32_OperatingSystem")

                                    For Each objSWbemObject In colSWbemObjectSet

                                    StrOS= objSWbemObject.Version

                                    Next

                        end If

            end If

 

            If StrOS = "5.0.2195" Then

                        Set oWshShell = CreateObject("WScript.Shell")

                        path = "\\OASCCM01\remote$\remote.exe"

                        'You will need to edit the following line to fit your environment.  SMSServer = Your SMS Server Name

                          oWshShell.run path & " 2 " & addresses(ubound(addresses)) & " \\OASCCM01\",0,False

                         Else

            Set oWshShell = CreateObject("WScript.Shell")

            path = "\\OASCCM01\remote$\rc.exe"

             oWshShell.run path & " 1 " & CompName & " \\OASCCM01\"

            end If

End Sub

 

For more info on using the remote tool at command line review this:  http://technet.microsoft.com/en-us/library/bb681027(TechNet.10).aspx

Published Tuesday, July 01, 2008 9:32 AM by cstauffer

Comments

# re: ConfigMgr 2007 Replacement Remote control button For Ron's Web Console@ Tuesday, July 08, 2008 11:53 AM

If you find that the 2000 machines are still not responding replace this line:

'oWshShell.run path & " 2 " & addresses(UBound(addresses)) & " \\servername\",0,False

With this:

oWshShell.run path & " 2 " & CompName & " \\servername\",0,False

we found that for some reason the addresses where not being resloved in all situations but the above change fixed the problem