September 2006 - Posts

SMS 2003 Toolkit's Clispy - RCrumbaker's Web Remote Tool

To make clispy.exe from the SMS Toolkit 2 available via Ron's web page, copy clispy.exe to <your server>\remote$

Edit MachRest.asp, and add a button by your other buttons (about line 80-ish):
<INPUT id="Button727" style='WIDTH: 180px' type='button' value='SMS CliSpy' name='Btnl727'>

Then add the below (the Sub) probably near the bottom, just before the </script>, after all of the other Sub/end Sub routines

Sub Btnl727_OnClick
 on error resume next
 dim oWshShell
 Set WShell = CreateObject("WScript.Shell")
 Set fso = createobject("scripting.filesystemobject")
 strExe = "\\" & ServerName & "\Remote$\CliSpy.exe"
 If NOT fso.FileExists(strExe) Then
     msgbox "Could not find Clispy.exe to run, Sorry.",,"CliSpy"
 Else
     document.parentwindow.clipboardData.SetData "text", trim(document.frmMain.txtValue.value)
     msgbox "Remember to hit Ctrl + C to connect to the remote computer." &_
         vbcrlf & "Otherwise you are simply looking at your own computer." &_
         vbcrlf &_
         vbcrlf & "For your convenience, the computer name of-->" & trim(document.frmMain.txtValue.value) &_
         vbcrlf & "has been copied to the clipboard, so you can just hit" &_
         vbcrlf & "Ctrl C, then Ctrl V, then enter to connect.",,"CliSpy"
         WShell.Run  Chr(34) & strExe & Chr(34),1,False
 End If
End Sub

Posted by skissinger | with no comments

Roger Zander's SMS Client Spy - RCrumbaker's Web Remote Tools

There is most likely a much more elegent way to do this; but here's a way to get Roger Zander's (http://sourceforge.net/projects/smsclictr) SMS Client Spy to launch from a button on Ron's page:

First, you'll need to install the application on a test box (you can uninstall when done).  Then copy the 3 files (SMSCliCtr.exe, Eyefinder.dll, and SMSCliCtr.exe.config) to <your server>\remote$  When I was testing, I found I couldn't launch the app directly from remote$, this may be something unique to my environment, but I've scripted it to copy the 3 files to the local user's temp folder, and then launch it from there.

Edit MachRest.asp, and add a button by your other buttons (about line 80-ish):
<INPUT id="Button726" style='WIDTH: 180px' type='button' value='SMS Client Center' name='Btnl726'>

Then add the below (the Sub) probably near the bottom, just before the </script>, after all of the other Sub/end Sub routines

Sub Btnl726_OnClick
 on error resume next
 dim CompName,oWshShell
 Set fso = createobject("scripting.filesystemobject")
 CompName = trim(document.frmMain.txtValue.value)
 Set WShell = CreateObject("WScript.Shell")
        DotNetpath = "%SystemRoot%\Microsoft.NET\Framework\v2.0.50727"
        DotNetpath = Wshell.ExpandEnvironmentStrings(dotnetpath)
        strTemp = wshell.ExpandEnvironmentStrings("%temp%")
        if fso.folderExists(dotNetPath) then
         fso.copyfile "\\" & ServerName & "\remote$\SMSCliCtr.exe",strTemp & "\"
         fso.copyfile "\\" & ServerName & "\remote$\Eyefinder.dll",strTemp & "\"
         fso.copyfile "\\" & ServerName & "\remote$\SMSCliCtr.exe.config",strTemp & "\"
         ipath = strtemp & "\SMSCliCtr.exe "
         if fso.fileExists(trim(ipath)) then
           WShell.run ipath & compname,1,false
           else
           msgbox "The SMS Client Center application was not found!",,"Application Missing"
         end if 'End if on file exists
         else
         msgbox "In order to run this utility, you need .Net 2.0 installed, sorry.",,".Net 2.0 Pre requisite"
         end if 'end if on needing .net 2.0
End Sub

Flash 9.0.16, Windows Installer 1603 error and oleaut32.dll

This may be old news, but it was new knowledge for me.  In troubleshooting why ~1% of the deployments of the latest Flash, 9.0.16.0, was erroring with 1603 error messages, I found this fix in a google search "Reregister some system .Dlls".  They listed several, but the one that worked for me was to re-register oleaut32.dll.

I ran a psexec remotely against the 30 boxes to silently reregister oleaut32.dll (psexec.exe \\machine name regsvr32 OleAut32.dll -s), sent a re-run the advertisement to the machines that reported a 1603, and they all ran successfully. 

I verified that worked by first doing just a couple; try to rerun the ad (fails w/1603), remotely reregister, and rerun again; all within the space a few minutes.  That pretty much decided it for me that it was re-registering that .dll.

So my failure stat has dropped from 1.3% failures to .5% failures (some of those boxes have gone home for the weekend--I'll have to catch up on them next week); but I really really like <1% failure!

Posted by skissinger | with no comments
Filed under:

Another Lookup User - Ron Crumbaker's Web Remote Tool

The Lookup User default button using the canned SMS report is great, but if you have installed Centerlogic's User Security Login Auditing Tool (SLAT) (http://www.centerlogic.com/sms_tools.html), you can add a report in your Admin Console leveraging that tool, and then add a button on Ron's web page to use that report in addition to the Find User button canned report.

First, have SLAT installed and working.  If you don't already have it, this step will be the most time consuming, since you may need to get permission to change Group Policies, run a recurring advertisement, as well as update the sms_def.mof in your environment.

Assuming that is done and working great... to use this information in machrest:

Edit MachRest.asp, and change this
<INPUT id="Button9" style='WIDTH: 175px' type='button' value='Find User' name='Btnl5'>

to this:
<INPUT id="Button9" style='WIDTH: 85px' type='button' value='Find User 1' name='Btnl5'><INPUT id='Button725' style='WIDTH: 85px' type='button' value='Find User 2' name='Btnl725'>

You may need to adjust the WIDTH values until it looks pleasing.

Attached is a text file; save it as a .mof and import it into your SMS Admin Console Reports.  After importing the report, take note of the ReportID it was assigned.  Run the report manually to make sure the report works in your environment; using % in the input field when running manually; i.e., %john% should report back all users with names of John.

Copy/Paste the below section (the Sub) probably near the bottom, just before the </script>, after all of the other SUB/end Sub routines.  You need to make two changes to this Subroutine.  #1:  Change <SiteCode> to be your reporting site code.  #2, change <your report number here> to be the ReportID you took note of in your console.

Sub Btnl725_OnClick
 on error resume next
 dim CompUser
 Compuser = trim(document.frmMain.LLUValue.value)
  if len(trim(Compuser)) = 0 then
  msgbox "Please type a Part of the User's First or Last Name.",,"Extended UserName Lookup"
 else
 parent.frames.output.location.href "/SMSReporting_<SiteCode>/Report.asp?ReportID=<your report number here>&Variable=%2525" & CompUser & "%25"
 end if 
End Sub

Posted by skissinger | with no comments

Book Review - SMS 2003 Recipes

I just got my copy of "SMS 2003 Recipes" from Amazon, and all I can say is "Wow".  Excellent approach to everything SMS.  I like the concept, the problem/solution format, the "discussion" sections that will help a newbie understand why they might want or need that function, and the references directing the reader to additional resources.  Obviously, I haven't read it cover to cover, but just browsing through it I'm totally impressed.  I can see replying to many of the Myitforum sms2003 threads with "did you check out chapter x, section y in SMS2003 Recipes yet?  The solution is right there...

I'm going to keep this copy at home; and make work buy a copy for me to keep at my desk!

Posted by skissinger | with no comments

Toggle Remote Desktop - Ron Crumbaker's Web Remote tool

In our environment, the default on the XP image is to not have Remote Desktop enabled.  But then there are always exceptions--we have Kiosk-type workstations in common areas.  The techs wanted a way to Toggle Remote Desktop on and off so when they had to do work on these computers, they could toggle on RDP, log in remotely, do the work, and then toggle RDP off again.

Edit MachRest.asp, and add a button by your other buttons (about line 80-ish):
<INPUT id="Button724" style='WIDTH: 180px' type='button' value='Toggle RDP' name='Btnl724'>

Then copy/paste the attached information (the Sub) probably near the bottom, just before the </script>, after all of the other SUB/end Sub routines.

The subroutine has several error-checking things in it: is the computer pingable, do you have rights to the WMI, and then is the computer not a server.  Only if you have rights to the WMI, and it's not a server, can you toggle.  I had to add in the error checking because some techs would have admin rights to a server, and it was attempting to toggle Terminal Services on a Server.

Uninstall by Guid example - vbscript

usage: cscript/wscript NameOfScript.vbs {GUID} {GUID} etc.; again, just putting it here mostly for myself for reference.

On error resume Next

CountApps = Wscript.Arguments.Count
If Wscript.Arguments.Count = 0 Then
 'nothing to do
 wscript.quit(0)
End If

For i = 0 to CountApps
 For Each Product In GetObject("winmgmts:{impersonationLevel=impersonate}!//localhost").ExecQuery("select * from Win32_Product where IdentifyingNumber='" & wscript.arguments(i) & "'")
  Product.Uninstall
 Next
Next

wscript.quit(0)

Posted by skissinger | with no comments

Kill Process w/Parameter example - vbscript

usage:  wscript or cscript  NameOfScript.vbs process1.exe process2.exe   etc.   I know this is probably in the MyItforum code examples, just putting it here for my own use.

On error resume Next

CountApps = Wscript.Arguments.Count
If Wscript.Arguments.Count = 0 Then
 'nothing to do
 wscript.quit(0)
End If

For i = 0 to CountApps
 For Each Process In GetObject("winmgmts:{impersonationLevel=impersonate}!//localhost").ExecQuery("select * from Win32_Process where Name='" & wscript.arguments(i) & "'")
  Process.Terminate
 Next
Next

wscript.quit(0)

Posted by skissinger | with no comments
Filed under:

EventLog - vbscript

This is elsewhere, just writing it here so it's easy to find for myself:

Set sho = CreateObject("WScript.Shell")
sho.LogEvent 4, "Script started."                 ' Information
sho.LogEvent 2, "An error occured."            ' warning
sho.LogEvent 0, "Something worked."         ' success
sho.LogEvent 1, "Something failed."            'Error
sho.LogEvent 8, "Audit Success."               'Audit Success
sho.LogEvent 16, "Audit Failed."               'Audit Failure

Posted by skissinger | with no comments
Filed under:

CurrentDir - vbscript

This is elsewhere, just writing it here so I can find it easier myself...

 strCurrentDir = Left(Wscript.ScriptFullName, (InstrRev(Wscript.ScriptFullName, "\") -1))

Posted by skissinger | 1 comment(s)
Filed under:

Remote Regedit - Ron Crumbaker's Web Remote Tool

[Edit] Unfortunately, the new(er) regedit.exe, I never could find a way to script that to immediately connect to a remote computer.  But grab a copy of regedt32.exe from \system32.  Copy that into your <smsserver>\remote$ share.

 Edit MachRest.asp, and add a button by your other buttons (about line 80-ish):
<INPUT id="Button723" style='WIDTH: 180px' type='button' value='Regedit' name='Btnl723'>

Then copy/paste the attached information (the Sub) probably near the bottom, just before the </script>, after all of the other SUB/end Sub routines.

If someone does know how to script regedit to remotely connect to a computer let me know!

User Info from Active Directory - RCrumbaker's Web Remote Tool

The original author of this script is Ralph Montgomery, I've modified it to work as a button on Ron's page.  To use it, edit machrest.asp, and after this section of code:

<INPUT id="Button9" style='WIDTH: 175px' type='button' value='Find User' name='Btnl5'>

Add this:

<INPUT id="Button722" style='WIDTH: 175px' type='button' value='Active Directory Info' name='Btnl722'>

Then copy/paste the attached information (the Sub) probably near the bottom, just before the </script>, after all of the other SUB/end Sub routines.

Posted by skissinger | 2 comment(s)

Machine Details instead of Resource Explorer - Ron Crumbaker's Web Remote Tools

To make the Web Remote Tools more portable, I replaced the "Resource Explorer" button to instead redirect to the integrated Reporting Console "MachDetails.asp".  You can add as many per-machine reports as desired by creating new Reports at the admin console, and just check on "Display in Computer Details", and make sure you add a prompt and qualifier to limit the report to a computer name.  See any canned report that ends in "for a specific computer" for an example.

To make this change in machrest.asp, replace 2 things:

#1 from this: <input style='WIDTH: 180px' type='button' value='Resource Explorer' name='Btnl7' ID='Button6'>
to this:  <input style='WIDTH: 180px' type='button' value='SMS Machine Info' name='Btnl7' ID='Button6'>

#2: replace the entire Sub Btnl7_OnClick (from Sub to End Sub) with this, replacing the _sitecode with your sitecode on your Reporting server

Sub Btnl7_OnClick
 dim CompName,oWshShell
 CompName = trim(document.frmMain.txtValue.value)
 if len(trim(CompName)) = 0 then
 parent.frames.output.location.href "/SMSReporting_sitecode/MachDetails.asp"
 else
 parent.frames.output.location.href "/SMSReporting_sitecode/MachDetails.asp?Machine=" & CompName
 end if
End Sub

User Policy Refresh - Ron Crumbaker's Web Remote Tools

Attempting to remotely invoke a user policy refresh proved to be one of the hardest things to do--it always wanted to refresh using the credentials of the user running the remote tool, or SYSTEM, or anything but the logged in user.  With Stuart Watret (http://offshore-it.co.uk/), we found a way to invoke the user policy refresh remotely under the user's credentials.

 To add this button, add a line among the buttons near the top of machrest.asp; the placement of this new button is up to you.

<INPUT id="Button721" style='WIDTH: 151px' type='button' value='SMS User Policy Refr' name='Btnl721'>

Then copy/paste the attached information (the Sub) probably near the bottom, just before the </script>, after all of the other SUB/end Sub routines.

Eliminate spaces in 'compname' - Ron Crumbaker's Web Remote Tools

In machrest.asp, in almost every Sub Btnlxx_OnClick, there is a line:

  CompName = document.frmMain.txtValue.value  or  Compuser = document.frmMain.LLUValue.value

 I changed those lines to be (respectively):

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

Compuser = trim(document.frmMain.LLUValue.value)

Kind of a minor change, I know; but when the techs would do a lookup user, and then copy/paste the computer to the computer field at the top, occasionally the highlight would pick up spaces as well as the username.  This allowed for this potential user error, and trimmed out the trailing or pre- spaces, and the buttons would work.

More Posts Next page »