October 2006 - Posts

SMS Remote Assistance - RCrumbaker's Web Remote Tool

After loading the SMS console, using the right-click tool to launch Remote Assistance on a computer will immediately attempt a connection.  You can duplicate this feature using Ron's web page.

First, you need to grab a copy of the smsunsolicitedrcui.htm file.  This file is located on any computer where you've already installed the SMS Admin console, in this (very long) directory:  "c:\windows\PCHEALTH\HELPCTR\Vendors\CN=Microsoft Corporation,L=Redmond,S=Washington,C=US\Remote Assistance\Escalation\Unsolicited"

If you've followed the instructions for sharing out sms\bin\i386 as remote$, you can copy smsunsolicitedrcui.htm into that folder on your server.  If for some reason that is unacceptable, place this file on a \\server\share that is available to all of your Remote Web page users as at least read-only, and adjust the source below accordingly.

Edit machrest.asp (make a backup first), and find the sub btnl10_onclick.  Replace the entire section from sub btnl10_onclick to end sub with the attached (be careful of word wrap).  Make sure to modify the <server>\<share> to match where you are offering the htm file.

The logic behind the script...
if no computer name is present, it will attempt a normal Offer Remote Assistance.  If there is a computer name present, it'll check for the smsUnsolicitedRCUI.htm.  If found, it'll immediately attempt a connection.  If not found, it'll try to download it from the source location you put in.  If for some reason the copy failed, it'll fall back to normal Offer Remote Assistance.

Posted by skissinger | with no comments

Target Computers by Users' usergroup membership

Problem:  The *they* in your organization (whether that is management, another team you don't have influence over, or just policies that are difficult to influence at this time), *they* want you to advertise software to users in a usergroup.  But you know that although SMS can target users and usergroups, software distribution history on the local client goes into a different area in WMI, and the right-click tools, SMSClient Center, and lots of other wonderful SMS utilities either don't interface with that user-specific WMI area at all, or are inconsistent, so you want to advertise to the Machines, not the users.

Solution:  From http://www.systemcentertools.com, grab Security Login Audit Tool (SLAT).  Follow the instructions for configuring SLAT (requires 3 basic things: you may need modify your GPO settings to record Security Audit information locally in the event log, modify your sms_def.mof (and compile it on the server and all clients), and schedule the SLAT scan to run on a recurring basis.  But once that is done, you can use the new tables/views created to get "computers where the highest ranked user is a member of usergroup <whatever>".  Example of a query-based collection below.  The example below also limits the results to machines that have reported a Hardware Inventory in the last 7 days.

select SMS_R_System.ResourceID,SMS_R_System.ResourceType,
  SMS_R_System.Name,SMS_R_System.SMSUniqueIdentifier,
  SMS_R_System.ResourceDomainORWorkgroup,SMS_R_System.Client
from
SMS_R_System inner join SMS_G_System_MCS_USERLOGONINFO_1_0
  on SMS_G_System_MCS_USERLOGONINFO_1_0.ResourceID = SMS_R_System.ResourceId
  inner join SMS_G_System_WORKSTATION_STATUS
  on SMS_G_System_WORKSTATION_STATUS.ResourceID = SMS_R_System.ResourceId
where
SMS_G_System_MCS_USERLOGONINFO_1_0.UserName in
(select UserName from  SMS_R_User where UserGroupName like "%TechnologyPilot%") and SMS_G_System_MCS_USERLOGONINFO_1_0.UserRank = 1 and
datediff(day,SMS_G_System_WORKSTATION_STATUS.LastHardwareScan,getdate()) <= "7"

You could of course do something similar without the user ranking add-on; but you will most likely get inconsistent results as the v_r_system.user_name0 can change or be blank.  If you are SP3, and have it enabled, you could replace the SLAT information and instead use the Console User information.

Posted by skissinger | with no comments
Filed under:

Helpful 'how to use' WMIDiag

http://blogs.msdn.com/wmi/archive/2006/05/12/596266.aspx

 I know, a blog entry with just a link somewhere else is kind of lame.  But I didn't want to forget where this info was.

Posted by skissinger | with no comments
Filed under:

The Mini-Monster Mof

I've finally scheduled updating from SMS 2003 SP1 to SP2; and took the opportunity to also clean up the sms_def.mof  While I'm waiting for Primary site 3 of 4 to finish, I thought I'd blog about it... I'm following Jeff Gilbert's guide and using a "mini-monster"  (I've called it Mini_mo.mof in /hinv -- yep, I did just re-watch Austin Powers on cable lately).  I really like the idea of barely modifying the sms_def, and putting all the add-ins in a separate file.  I don't want to reveal too many of Jeff's secrets--buy his book--but I was skeptical at first (is it really that simple? yes, it is) when the book only had a few pages about using a mini-monster; but it was that simple.

After cleanup, our Mini_mo now has the following:
1) An expanded Add Or Remove Programs.  It doesn't add to the existing one, it's a whole new one.  This was inherited, and we've got lots of collections built around this view, so kept it.
2) Profile List.  No idea, actually, why a predecessor put this in.  It just lists entries in hklm/software/microsoft/Windows NT/Current Version/ProfileList.  I left it in.  I think it was a way to figure out who has logged into the computer, ever; but we now use Steve Bobosky's tool. So I could probably remove this and clean up the tables... Eh... sounds like work. Leave it be.
3) Steve Bobosky's Secure Logon Audit Tool (This I *know* why I have it; highest ranked user!)
4) SMS Expert MOF additions for Drives, printers, shares, and a slightly modified local admins
5) SMS Advanced Client Cache (so I can figure out if a machine needs more sms cache set before specific packages)
6) MSI customizations (Intrinsic-customized addition to any Transforms or repackages we do with Installshield)
7) Power Audit (from an article http://www.myitforum.com/articles/12/view.asp?id=9101 and team members needed to know power settings on laptops)
8) Image ID (hklm/system/setup/oemduplicatorstring as ImageID, CloneTag as Imaged date)
9) Monitor Inventory (although it's still not perfect) http://www.myitforum.com/articles/8/view.asp?id=8489
10) MOFFileRevision (mof version stamping, so I can target machines that haven't compiled the latest mof) http://www.myitforum.com/articles/1/view.asp?id=3185

In case anyone is interested, attached is the additional section for ARP. Carefully evaluate how much (or if at all) you need this.

Posted by skissinger | with no comments
Filed under:

WMIC and Windows Installer products

Windows Installer (.MSI) installs are great for remote administration.  One of the under-utilized tools (IMHO) is WMIC, the WMI interface from a command prompt.  I got these tips from Darwin Sanoy, when I took his excellent class on Windows Installer. (http://www.windowsinstallertraining.com)

Examples of some commands:

To get a list of all MSI products installed on the remote computer:
WMIC /node:"computername" product list > c:\1.txt
WMIC /Node:"computername" /output:c:\1.csv product get /format:csv

To uninstall (similar to msiexec /x {guid} /qn):
WMIC /node:"computername" product where name="Widgets" call uninstall

To uninstall using alternate credentials:
WMIC /node:"computer" /user:"userid" /password:"yourpassword" product where name="Widgets" call uninstall

Why would you use this?  I only occasionally have needed this; but once in a while during a company-wide rollout & a few machines upgraded badly, the easiest solution is to uninstall and reinstall the app.  Since you can't easily use SMS to trigger an uninstall for 1-off computers quickly without remote controlling the box or sending a tech, I've used this to uninstall an app, and then used any one of multiple available tools to re-run the mandatory SMS advertisement.

If you don't know the name of the product, use the list command to dump it; and then you can use one of the uninstalls.  I know this information is usually available in the Add/Remove Programs information reported to SMS--but when you are in troubleshooting mode, this is a way to get accurate information about what is installed.

Notes: Because there are occasionally .MSIs that were crafted in ways where the product information is not populated into the WMI class win32_product, if you are expecting to see a product and it is not listed, that particular application may have been crafted in that way.  In those (rare) cases, a remote session, local tech, or some other solution will be required.

Posted by skissinger | with no comments
Filed under: ,