July 2007 - Posts

MOF edit - Remote Assistance Requests Accepted

Edit:  Jeff wrote up a much better way to get this information.  Please ignore the below (unless you plan on just using it as a template for something else), but if you are looking for Remote Assistance information, use this: http://myitforum.com/cs2/blogs/jgilbert/archive/2007/08/08/inventorying-remote-assistance-requests-and-connections.aspx

By request, and using Jeff Gilbert's original code as a template, here's a MOF edit to pull event ids 5103 from the Application Event Log; which are essentially Remote Assitance Accepted requests.  If you are tasked with reporting Remote Assistance performed by technicians, this is one way to gather that information.  As cautioned by Jeff, and observed by others, when using a mof edit (like this one) which may perform resource-intensive WMI queries on your client computers, please test this MOF edit thoroughly; or be prepared to remove it from production if you find it has an adverse impact during a Hardware Inventory action on your clients.

 //<<<<<<<<<<<<<<Start-Remote Assistance Requests Accepted-Start>>>>>>
#pragma namespace("\\\\.\\root\\cimv2")
[Union, ViewSources{"Select * FROM Win32_NTLogEvent
WHERE LogFile = 'Application' AND EventCode = 5103"},
ViewSpaces{"\\\\.\\root\\cimv2"},
dynamic,provider("MS_VIEW_INSTANCE_PROVIDER")]
class RemoteAssistanceAccepted
{
[PropertySources("LogFile"), Key] string LogFile;
[PropertySources("RecordNumber"), Key] UINT32 Recordnumber;
[PropertySources("Message")] String Message;
[PropertySources("TimeGenerated")] DateTime TimeGenerated;
};
//-------------------------- Reporting Class---------------------------
#pragma namespace("\\\\.\\root\\CIMV2\\SMS")
[SMS_Report(TRUE), SMS_Group_Name("Remote Assistance Accepted"),
SMS_Class_ID("MICROSOFT|RemoteAssistanceAccepted|1.0") ]
class RemoteAssistanceAccepted: SMS_Class_Template
{
[SMS_Report(TRUE), Key] String LogFile;
[SMS_Report(TRUE), Key] UINT32 RecordNumber;
[SMS_Report(True)] String Message;
[SMS_Report(True)] DateTime TimeGenerated;
};

//<<<<<<<<<<<<<<<<End-Remote Assistance Requests Accepted-End>>>>>>>>>>

 As an example, what's reported is
LogFile: Application
Time Generated: 7/11/2007 8:15:00 PM
Message:  RA: Expert user (remote user: usr321) has started controlling novice (local user: usr654)

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

MOF edit for .net framework versions

Updated for 4.0:  http://myitforum.com/cs2/blogs/skissinger/archive/2009/12/16/hardware-inventory-mof-edit-for-net-framework-versions-updated.aspx

If you support Vista, or need to know if .net version 3.5 beta is installed, the attached MOF edit will help.  It will report on installed for .net versions 1.1, 2.0, 3.0, and 3.5 (beta).  Since 3.5 is in beta, it's possible the mof may not report 3.5 correctly once it's officially released.

Note this MOF edit will NOT help you determine if you need hotfixes for .net framework; you will still need ITMU or WSUS.

In the attached zip are 2 mof files; 1 is the mof snippet to be added to your mini.mof (or sms_def.mof), and the other is 3 reports which could be imported for reporting.  The 3 reports are designed so they could be linked together.

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

Move Computer Account to another OU vbscript

As part of our imaging process, after the computer is joined to the domain, based on the first production ID logging into the system, we run the attached vbscript.  The script is run using account credentials with rights in AD to move computers.

The goal of this script was to take a usergroup that every production ID belongs to (in the attached example, every production ID has a "home base" so to speak).  The script looks for the 'Base' group membership, and sets a variable for the OU where the computer account should be moved to.  If a new OU could not be determined, an email is sent to a list of people.  This was useful in our case so that #1: we can move the computer into the appropriate OU for Group Policy, and also we have other automation tasks that require production IDs to have a "base" group membership. 

If the script can correctly determine the target OU, it then looks for the computer account in 1 of two OU's:  The generial Computers OU, or in this script example, the Temporary OU.   It then moves the computer to the new OU.

If you plan on using this script, change the 3 variables at the top Company... to match valid email accounts, an SMTP internal server, and a sender email.  You would also need to adjust what group you're looking for, and set the OuToMoveTo = to be appropriate for you environment.

Posted by skissinger | with no comments
Filed under: