Archive

Archive for the ‘3rd Party Tools’ Category

Web Remote Console v3.2.1 Client Log Files

March 22, 2011 Leave a comment

Here is another button for Ron Crumbaker’s Web Remote Console v3.21. This button will open a log file on the remote device. Be sure to fill in your server name for the Remote$ share.

<tr>
    <TD vAlign="top" width="371" height="64">
    <P><strong><font size="3">Select a Log File to Open on the Device</font></strong>
    <SELECT id="Select2" style="FONT-SIZE: 10pt" size="1" name="Select2">
        <option selected>CAS.log 
        <option>CcmExec.log
        <option>execmgr.log
        <option>LocationServices.log
        <option>UpdatesDeployment.log
    </select>
    <P><INPUT id="Button22" style="FONT-SIZE: 10pt" type="button" value="Open Log File " name="SndBtn22"></P>
    </TD>
</tr>

‘———————————————————————————-
‘Opens log files from the remote device
‘———————————————————————————-
Sub SndBtn22_OnClick
on error resume next

DIM CompName, strExe, logValue, WShell, fso

CompName = trim(document.frmMain.txtValue.value)
logValue = document.frmMain.select2.selectedIndex
 
Set WShell = CreateObject("WScript.Shell")
Set fso = createobject("scripting.filesystemobject")
strExe = "\\SERVERNAME\Remote$\trace32.exe"
If NOT fso.FileExists(strExe) Then
    msgbox "Could not find SMS Trace."
Else

    if logValue = 0 Then
        logFile = "CAS.log"
    end if

    if logValue = 1 Then
        logFile = "ccmexec.log"
    end if
 
    if logValue = 2 Then
        logFile = "execmgr.log"
    end if
 
    If logValue = 3 Then
        logFile = "locationservices.log"
    end if
 
    if logValue = 4 Then
        logfile = "updatesdeployment.log"
    End If
 
    WShell.Run  strExe & " \\" & CompName & "\C$\windows\system32\ccm\logs\" & logFile

End If
 
End Sub

Advertisements
Categories: 3rd Party Tools

Web Remote Console v3.2.1 Rebuild WMI

March 22, 2011 Leave a comment

Here is another button for Ron Crumbaker’s Web Remote Console v3.21. This button will rebuild the WMI repository on the remote device. Be sure to note the psexec.exe reference in the “Remote$” share.

‘———————————————————————————-
‘This button will rebuild the WMI repository
‘———————————————————————————-
Sub Btnl35_OnClick
on error resume Next
Dim CompName, WShell, strCommand

CompName = trim(document.frmMain.txtValue.value)
Set WShell = CreateObject(“WScript.Shell”)
strCommand = “\\SERVERNAME\remote$\psexec.exe \\” & CompName & ” -s /accepteula \\SERVERNAME\remote$\WMIFixWORebuild.cmd

if len(trim(CompName)) = 0 Then
msgbox “Please type a Machine Name.”,,”Uninstall SCCM Client”
Else
Set objPing = GetObject(“winmgmts://” & ServerName & “/root/default:PingPoller”)
objPing.Ping CompName, “100”, “1”, PingResult
‘msgbox PingResult
if PingResult <> 0 then
msgbox “Machine did not respond to ping.”,,””
else
‘msgbox “This Function is Under Development…”

intReturn = wshell.Run(strCommand,0,false)
IF intReturn = 0 THEN
msgbox “The WMI repository has been rebuilt.”
ELSE
msgbox “Access Denied with Error: ” & intReturn
END IF

end if
end if

End SUb

‘———————————————————————————-

 

***WMIFixWORebuild.cmd (create the file and place in the Remote$ share)***

net stop winmgmt /y
rename %windir%\System32\Wbem\Repository %windir%\System32\Wbem\Repository_bad
net start winmgmt

rundll32 wbemupgd, UpgradeRepository

cd /d %windir%\system32\wbem
for %%i in (*.dll) do RegSvr32 -s %%i
del wbemtest.bak
rename wbemtest.exe wbemtest.bak
for %%i in (*.exe) do %%i /RegServer
rename wbemtest.bak wbemtest.exe

————————————————————————————————

Categories: 3rd Party Tools

Web Remote Console v3.21 Delete from AD

Here is yet another button for Ron Crumbaker’s Web Remote Console v3.21.  This script deletes the device from AD but does not allow deletion of objects with Windows Server in the Operating System attribute.

‘———————————————————————————-
‘This button will remove the device from AD.
‘———————————————————————————-
Sub Btnl32_OnClick
    on error resume Next
    Dim CompName, intrespond, intInput
    CompName = trim(document.frmMain.txtValue.value)
    IF len(trim(CompName)) = 0 THEN
        msgbox “Please type a Machine Name.”,,”Uninstall SCCM Client”
    Else
        ExecuteSearch = SearchDistinguishedName(CompName)
    END IF
End SUB

‘———————————————————————————-
‘Searches for a distinguished name for AD deletion
‘———————————————————————————-
Public Function SearchDistinguishedName(ByVal vSAN)
    Const ADS_SCOPE_SUBTREE = 2
    Dim oRootDSE, oConnection, oCommand, oRecordSet, intrespond, strOS, strCurDom, objComputer, strLocation, strNotinAD
    Set oRootDSE = GetObject(“LDAP://rootDSE”)
    Set oConnection = CreateObject(“ADODB.Connection”)
    oConnection.Open “Provider=ADsDSOObject;”
    Set objCommand = CreateObject(“ADODB.Command”)
    objCommand.ActiveConnection = oConnection
    strCurDom = “‘LDAP://” & oRootDSE.get(“defaultNamingContext”) & “‘”    intRespond = MsgBox(“The current domain set is: ” & strCurDom & ” is this same domain as the device you wish to delete?  Please note that this can take up to 1 minute.”, vbYesNo + vbQuestion + vbSystemModal, “Domain”)
        If intrespond = vbYes Then
            ldstring = “‘LDAP://” & oRootDSE.get(“defaultNamingContext”) & “‘”
        ELSE
            IF intrespond = vbNo THEN
                intInput = msgbox(“Please log into the console on a device in the appropriate domain to accomplish this.”, vbInformation + vbSystemModal, “Domain”)
            END IF
        END IF    objCommand.CommandText = “Select Name, distinguishedName, operatingSystem from “& ldstring & ” where objectClass=’computer'”     objCommand.Properties(“Page Size”) = 1000
    objCommand.Properties(“Timeout”) = 30
    objCommand.Properties(“Searchscope”) = ADS_SCOPE_SUBTREE
    objCommand.Properties(“Cache Results”) = False
    Set objRecordSet = objCommand.Execute
    objRecordSet.MoveFirst
    Do Until objRecordSet.EOF
        IF lcase(objRecordSet.Fields(“Name”).Value) = lcase(vSan) THEN
            strOS = objRecordSet.Fields(“operatingSystem”).Value
            IF Instr(ucase(strOS), UCase(“Server”)) THEN   
                intrespond = msgbox (“Deletion of server objects from AD is not allowed via this console.”, vbInformation + vbSystemModal, “Domain”)
                strNotinAD = “No”
                Exit Do
            ELSE
                intrespond  = msgbox (“Are you sure you want to delete this device from AD?” & vbCrLf _
                & “Computer Name: ” & objRecordSet.Fields(“Name”).Value & vbCrLf _
                & “Location: ” & objRecordSet.Fields(“distinguishedName”).Value  & vbCrLf _
                & “Operating System: ” & objRecordSet.Fields(“operatingSystem”).Value, vbYesNo + vbQuestion + vbSystemModal, “Domain”)
                strLocation = chr(34) & “LDAP://” & objRecordSet.Fields(“distinguishedName”).Value & chr(34)
                ‘intrespond   = msgbox (strLocation, vbInformation + vbSystemModal, “Domain”)
                IF intrespond = vbYes THEN
                    Set objComputer = GetObject(“LDAP://” & objRecordSet.Fields(“distinguishedName”).Value)
                    ‘objComputer.Delete (0)
                    objComputer.DeleteObject(0)
                    intrespond   = msgbox (“Computer Name: ” & objRecordSet.Fields(“Name”).Value & ” has been deleted from ” & strLocation, vbInformation + vbSystemModal, “Domain”)
                    strNotinAD = “No”
                    Exit Do
                ELSE
                    intrespond   = msgbox (“The device HAS NOT been deleted from AD.”, vbInformation + vbSystemModal, “Domain”)
                    strNotinAD = “No”
                    Exit Do
                END IF
            END IF
        ELSE
            strNotinAD = “Yes”
        END IF
        objRecordSet.MoveNext
    Loop
    If strNotinAD = “Yes” THEN
        intrespond   = msgbox (“The device was not found in AD.  Please verify the name.”, vbInformation + vbSystemModal, “Domain”)
    END IF
End Function

Categories: 3rd Party Tools

Web Remote Console v3.21 Delete Device From SCCM

May 18, 2010 6 comments

Here is another button for Ron Crumbaker’s Web Remote Console v3.21.  This deletes the device from the SCCM database.

‘———————————————————————————-
‘This button will remove the device from the SCCM database.
‘———————————————————————————-
Sub Btnl???_OnClick
    on error resume Next
    Dim CompName, strSMSServer, strSMSSiteCode, objResource, intResourceID, strQuery, colResourceIDs, colResourceID, objResourceID
    CompName = trim(document.frmMain.txtValue.value)
    strQuery = “SELECT sms_R_System.ResourceID from sms_R_System where sms_R_System.Netbios_Name0 = ‘” & CompName & “‘”
    strSMSServer = “SERVERNAME”
    strSMSSiteCode = “???
    Set objLoc =  CreateObject(“WbemScripting.SWbemLocator”)
    Set objSMS= objLoc.ConnectServer(strSMSServer, “rootsmssite_” & strSMSSiteCode)
    IF Err THEN
        Err.Clear
        msgbox “Access Denied…you are not connected to SCCM.  Please verify your credentials.”
    ELSE
        if len(trim(CompName)) = 0 Then
            msgbox “Please type a Machine Name.”,,”Delete from SCCM”
        Else            Set colResourceIDs = objSMS.ExecQuery (strQuery)
            for each colResourceID in colResourceIDs
                objResourceID = colResourceID.ResourceID
                ‘msgbox colResourceID.ResourceID
            next            ‘Remove ResourceID
            Set objResource = GetObject(“WinMgmts:\” & strSMSServer & “rootSMSsite_” & strSMSSiteCode & “:SMS_R_System.ResourceID=” & cstr(objResourceID))
            objResource.Delete_
            msgbox “Deleted ” & CompName & ” which had a resource id of: ” & objResourceID & “.”
        end if
    END IF
End SUb

Categories: 3rd Party Tools

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

May 17, 2010 2 comments

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

Categories: 3rd Party Tools

Web Remote Console v3.21 Windows Version Check for RA

In using the Web Remote Console v3.21 created by Ron Crumbaker we ran into an issue with some people doing support with Windows 7/Windows Server 2008 devices and some doing support with Windows XP or via a Citrix session on Windows Server 2003.  To account for the differences with Remote Assistance (msra.exe and helpctr.exe)  I leveraged some code from Sherry Kissinger and added an OS check earlier in the “machrest.asp” file.  It might not be super clean but it gets the job done!  :0)

***Please remember that RA is a feature that needs to be added in Windows Server 2008***

Web Console: http://www.myitforum.com/articles/2/view.asp?id=8662 
Reference: http://myitforum.com/cs2/blogs/skissinger/

Sub CheckOS

dim shell, strOS, strVerKey, strVersion, ObjFSO
Set objFSO = CreateObject(“Scripting.FileSystemObject”)
Set Shell = CreateObject(“WScript.Shell”)
strOS = shell.ExpandEnvironmentStrings(“%OS%”)
If strOS = “Windows_NT” Then
   strVerKey = “HKLMSOFTWAREMicrosoftWindows NTCurrentVersion”
   strVersion = Shell.regread(strVerKey & “ProductName”) & ” ” & Shell.regread(strVerKey & “CurrentVersion”) & “.” & Shell.regread(strVerkey & “CurrentBuildNumber”)
Else
  strVerKey = “HKLMSOFTWAREMicrosoftWindowsCurrentVersion”
  strVersion = Shell.regread(strVerKey & “ProductName”) & ” ” & Shell.regread(strVerKey & “VersionNumber”)
End if
‘MsgBox strVersion
    ‘msgbox “The current OS is ” & strVersion & “.”
If instr(strVersion, “Windows 7”) > 0 then
    ‘msgbox “Win7”
    strOSType = “Win7”
End If

If instr(strVersion, “2008”) > 0 then
    ‘msgbox “svr2k8”
    strOSType = “svr2k8”
End If

set Shell=nothing

End Sub 

‘———————————————————————————-
‘Opens the Remote Assistant Feature.  Grabs the ComputerName from the Textbox.
‘———————————————————————————-
Sub Btnl10_OnClick
    dim CompName, wshell, fso, strWindir, strSMSUnsolicitedFileSource, StrSMSDir, strSMSFile

    Set WShell = CreateObject(“WScript.Shell”)
    CompName = document.frmMain.txtValue.value
    Set fso = CreateObject(“Scripting.FileSystemObject”)
    strWindir = wshell.expandenvironmentstrings(“%windir%”)
     strSMSUnsolicitedFileSource = “\\SERVERNAME\remote$\smsunsolicitedrcui.htm”
    StrSMSDir = strwindir & “PCHEALTHHELPCTRVendorsCN=Microsoft Corporation,L=Redmond,S=Washington,C=USRemote AssistanceEscalationUnsolicited”
     strSMSFile = strSMSDir & “smsunsolicitedrcui.htm”

    IF strOSType = “svr2k8” THEN
        WShell.Run “%windir%\system32\msra.exe /offerra ” & CompName 
    ELSE
        IF strOSType = “Win7” THEN
            WShell.Run “%windir%\system32\msra.exe /offerra ” & CompName 
        ELSE
            if len(trim(CompName)) = 0 then
                 wshell.run “hcp://CN=Microsoft%20Corporation,L=Redmond,S=Washington,C=US/Remote%20Assistance/Escalation/Unsolicited/unsolicitedrcui.htm”
             else
                 if fso.fileExists(strSMSFile) Then 
                       WShell.Run strWindir & “pchealthhelpctrbinarieshelpctr.exe -FromStartHelp ” & _
                        “-url hcp://CN=Microsoft%20Corporation,L=Redmond,S=Washington,C=US/Remote%20Assistance/Escalation/unsolicited/UnsolicitedRCUI.htm ” & _
                       “-ExtraArgument ” & “NOVICECOMPUTER=” & CompName & “”””
                  else
                      fso.copyFile strSMSUnsolicitedFileSource,strSMSFile
                       if fso.fileExists(strSMSFile) Then 
                             WShell.Run strWindir & “pchealthhelpctrbinarieshelpctr.exe -FromStartHelp ” & _
                               “-url hcp://CN=Microsoft%20Corporation,L=Redmond,S=Washington,C=US/Remote%20Assistance/Escalation/unsolicited/SMSUnsolicitedRCUI.htm ” & _
                              “-ExtraArgument ” & “NOVICECOMPUTER=” & CompName & “”””
                       else
                            wshell.run “hcp://CN=Microsoft%20Corporation,L=Redmond,S=Washington,C=US/Remote%20Assistance/Escalation/Unsolicited/unsolicitedrcui.htm”
                       end if
                  End if
             end if

        END IF
    END IF
End Sub

Categories: 3rd Party Tools

3rd Party Tools – ConfigMgr DP Utility

January 11, 2010 Leave a comment
I have been meaning to add this since sometime in early 2009…then I needed to have it on a new device and forgot it is easier to find when searching "ConfigMgr" instead of "SCCM".  This is a super helpful tool for selecting packages to replicate to DP’s (or remove for that matter) in an easier fashion than the SCCM console and you can even copy another DP.
 
Big shoutout to Cory Becht for this tool!
 
Categories: 3rd Party Tools
%d bloggers like this: