Home > 3rd Party Tools > Web Remote Console v3.21 SCCM Client Install/Uninstall Buttons

Web Remote Console v3.21 SCCM Client Install/Uninstall Buttons


I had a request to add install and uninstall buttons for the SCCM client to by Ron Crumbaker’s Web Remote Console.  Additionally the requester wanted the “ccmsetup.log” file to automatically open using Trace32 for the remote device with the same button click. 

Below are the subs for the buttons (you need to sub your server’s name for SERVERNAME in the code)…I assume anybody looking to use them will know how to put them into the machrest.asp file.  However, if you have questions please post them.

‘———————————————————————————-
‘This button will install the SCCM Client
‘———————————————————————————-
Sub Btnl30_OnClick
    ‘on error resume Next
    dim CompName,oWshShell, strPSExec, smsClient, WShell, strExe, strCommand, strUsername, strPassword    strExe = “\SERVERNAMERemote$trace32.exe”    
    CompName = trim(document.frmMain.txtValue.value)
    strCommand = “\SERVERNAMEremote$psexec.exe \” & CompName & ” -s \SERVERNAMEremote$ccmsetup.exe /mp:SERVERNAME SMSSITECODE=123 SLP=SERVERNAME FSP=SERVERNAME”
    Set WShell = CreateObject(“WScript.Shell”)

    if len(trim(CompName)) = 0 Then
        msgbox “Please type a Machine Name.”,,”Install SCCM Client”
    Else
        Set objPing = GetObject(“winmgmts:{impersonationLevel=impersonate}!\SERVERNAME/root/default:PingPoller”)
        objPing.Ping CompName, “100”, “1”, PingResult
        if PingResult <> 0 then
            msgbox “Machine did not respond to ping.”,,””
        else   
            WShell.Run  strExe & ” \” & CompName & “C$windowssystem32ccmsetupccmsetup.log”
            intReturn = wshell.Run(strCommand,0,false)
            IF intReturn = 0 THEN
                ‘msgbox intReturn
            ELSE
                msgbox “Access Denied with Error: ” & intReturn
            END IF
        end if
    end if
End Sub’———————————————————————————-
‘This button will uninstall the SCCM Client
‘———————————————————————————-
Sub Btnl31_OnClick
    ‘on error resume Next
    dim CompName,oWshShell, strPSExec, smsClient, WShell, strExe, strCommand, strUsername, strPassword    strExe = “\SERVERNAMERemote$trace32.exe”    
    CompName = trim(document.frmMain.txtValue.value)
    Set WShell = CreateObject(“WScript.Shell”)
    strCommand = “\SERVERNAMEremote$psexec.exe \” & CompName & ” -s \SERVERNAMEremote$ccmsetup.exe /uninstall”
    if len(trim(CompName)) = 0 Then
        msgbox “Please type a Machine Name.”,,”Uninstall SCCM Client”
    Else
        Set objPing = GetObject(“winmgmts:{impersonationLevel=impersonate}!\SERVERNAME/root/default:PingPoller”)
        objPing.Ping CompName, “100”, “1”, PingResult
        if PingResult <> 0 then
        msgbox “Machine did not respond to ping.”,,””
        else   
            WShell.Run  strExe & ” \” & CompName & “C$windowssystem32ccmsetupccmsetup.log”
            intReturn = wshell.Run(strCommand,0,false)
            IF intReturn = 0 THEN
                ‘msgbox intReturn
            ELSE
                msgbox “Access Denied with Error: ” & intReturn
            END IF
        END IF
    END IF
End Sub

Advertisements
Categories: 3rd Party Tools
  1. Carla
    April 20, 2011 at 9:29 am

    I have been trying to added the install sccm client to my machrest.asp file. I have been copying and pasting to note pad adding my server name then pasting that to my machrest.asp file. When I try and save the file I get the following error (This file contains characters in unicode format which will be lost if you save this file as an ANSI encoded test file. Can you help me with this error?

    • April 20, 2011 at 11:45 am

      I would suggest trying to paste to a separate notepad instance and then into the machrest.asp file or typing it out manually to see if that gets around the issue.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: