Tuesday, April 10, 2007

Remote Assistance, and other computer info

Sometimes a user says they need assistance. To remote into their machine you need the computer name, this can be hard to find or search for. It also is hard sometimes for the user to give it to you. This query will help you put all that information together. You don't necessarily need to use this for remote assistance. With the user data (current & Last logged on) as well as the computer information you also have full access to the right click menu within SMS. Ever notice when you right click on a query of computers you don't always see the Remote Assistance or the Event view option. For these to appear you need to have the Resource ID and Resource type. This is a simple query that can be expanded to include the IP address or some other useful information. I have this labeled as Remote Assistance because I use it for assistanting users remotely. Please feel free to call it and modify it as needed or desired.



Object type:System Resource
Collection Limiting: No limited
---------------------Remote Assistance -------------------------------
select SMS_R_System.LastLogonUserName, SMS_G_System_COMPUTER_SYSTEM.UserName, SMS_G_System_COMPUTER_SYSTEM.Name, SMS_R_System.ResourceId, SMS_R_System.ResourceType from SMS_R_System inner join SMS_G_System_COMPUTER_SYSTEM on SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceId order by SMS_R_System.LastLogonUserName
------------------------------------------------
--no SMS_G_System-- (This is better for most right click tools and passing commands from the MMS)

select SMS_R_System.LastLogonUserName, SMS_R_System.Name, SMS_R_System.ResourceId, SMS_R_System.ResourceType from SMS_R_System order by SMS_R_System.LastLogonUserName

Sunday, April 8, 2007

Custom Popup Message

HTA or HTML Applications can be used for many things, installers, configurations pages, popups and much more. Here I demonstrate how to use them as a custom popup that your network users will recognize not as a spyware/trojan but has a message from the admin group. The background can consist of your company logo and the Admin pictures or something distinguishable.
This particular HTA file can be pushed to the machine and displayed to let the user know that he is out of compliance for patches. This can be accomplished by many ways:
1. Create a collection where the scan package is 1 or 2 versions back from where it should be. Pushing this down can warn the users that many many patches are about to install or that he/she needs to bring their laptop in for repairs because the Windows update feature isn't working correctly
2. Create a collection where the latest patch number MS07-0xx is not installed 2 weeks after Patch Tuesday.


---------------Popup.hta ----------
<head> <title>Message from <network admin group></title> <body background = "background.jpg">
<HTA:APPLICATION APPLICATIONNAME="NetworkGroup" SCROLL="NO" SINGLEINSTANCE="yes" WINDOWSTATE="normal" SYSMENU="no">
</head>
<script language="VBScript">
Sub Window_Onload window.moveTo 200,200 window.resizeTo 820,600 end sub
Sub Closeme window.close() end sub
</script>
<body >
<table width="790" border=0> <tr bgcolor="Yellow" height="8"> <td align="center"> Caution Caution Caution Caution Caution Caution Caution Caution Caution Caution Caution
</td> </tr> <tr height="350"> <td valign="center" > <font size="5" color="#0000FF" >
This system is not fully patched and is therefore a risk to our office. You are receiving this notification because your system is out of compliance for the following reason: <;br><br> This system may be experiencing problems receiving the MS updates. Please restart your PC. More patches may install after the restart. <br></font> </td> </tr>
<TR valign="bottom"> <td align="center" height="80" > <input type="button" value="Close Window" name="Closeout" onClick="Closeme" style="background:#f3f; "> </td> </tr> <tr bgcolor="Yellow" height="8"> <td align="center"> Caution Caution Caution Caution Caution Caution Caution Caution Caution Caution Caution </td> </tr> </table>
</body>


---------------------------
The color is to get your attention, change as needed.

See this MSDN article for more information:
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/hta/overview/htaoverview.asp

Friday, April 6, 2007

Collection of Computers based on Users

SMS has a nice feature that allows you to create a collection based on users. That way when a users logs into a computer SMS will then run an advertisement for whatever computer they are on. The problem is maybe you want to have a collection of computers not the users. The worst flaw this the collection query I have created below and using collections based on users is that if a person logs in to another machine, for whatever reason, SMS will find them and push software to them.
That in mind, here is a collection that will take any OU group of users and create a collection of computers.


---------------------------------------
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_COMPUTER_SYSTEM on SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COMPUTER_SYSTEM.UserName in (select UniqueUserName from SMS_R_User where UserOUName = "xxxx /SECURITY USERS & GROUPS” )
--------------------------------------
Windows User account and group discovery must be enabled and run on your server to use this.

How does this work. It first grabs the list of users. Then matches them to the comptuers that SMS currently sees them logged into. To change this to Last Logged in user you need to change the SMS_G_System_Computer_System to SMS_R_System.LastLogonUserName for computers. This will give you last logged in user.

"Limit to Collection" for all your computer Workstations or further limit it to based on departments

If you don't know what group then you can create a query of just (select UniqueUserName from SMS_R_User where UserOUName = "") click values until you have the value you need and paste it into the larger query.