Re: Hardware Inventory of registry SMS 2003 sms_def.mof

From: Sangeetha Visweswaran [MSFT] (sangeev_at_online.microsoft.com)
Date: 06/29/04


Date: Tue, 29 Jun 2004 14:37:23 -0700

The attached image just shows the KeyName as KeyNames which is the value it
will inventory as that is what is being set in the defmof. Are the other
details also shown in the Reosource explorer. If there are not, can you
check WMI, under root\cimv2 namespace(using wbemtest) to see if the class
CCCImageDetails is existing and check the instances and see what properties
have values?

-- 
Hope this helps!
Sangee
P.S:Please do not send e-mail directly to this alias. This alias is for 
newsgroup purposes only.
"This posting is provided AS IS with no warranties and confers no rights."
"Steve Adams" <steven.adams@nospam.com> wrote in message 
news:uOHBe4XXEHA.3676@TK2MSFTNGP09.phx.gbl...
>I have managed to get the advanced client to do a sms_def.mof update.
>
> I modified two scripts found on www.myitforum.com into a sigle script and
> ran it as a package on the clients.
> I have included the script in-case anyone else needs it.
>
> I now have information within the sms console but it's not what I 
> expected.
>
> I have attached a small pic of the results (temp.jpg):
>
> Any ideas would be apprectiated,  at this point I am assuming it is my 
> lack
> of understanding of mof file synyax.
>
> /Steve
>
>
> The following is the registry keys I am trying to capture:
>
> Windows Registry Editor Version 5.00
>
> [HKEY_LOCAL_MACHINE\SOFTWARE\CCCImageDetails]
> "Build Date"="28/06/2004"
> "Build Type"="CCCSTD"
> "Build Version"="1.2.18"
> "Imaged Date"="29/06/2004"
>
> The following is the modified part of the sms_def.mof:
>
> // -- Start of CCCImageDetails --
>
> #pragma namespace ("\\\\.\\root\\cimv2\\sms")
>
> [ SMS_Report(TRUE),
>  SMS_Group_Name("CCCImageDetails"),
>  SMS_Class_ID("MICROSOFT|CCCImageDetails|1.0")]
>  class CCCImageDetails : SMS_Class_Template
> {
>     [SMS_Report (TRUE), key ]
>        string KeyName;
>     [SMS_Report(TRUE)]
>      string BuildDate;
>     [SMS_Report(TRUE)]
>      string BuildType;
>     [SMS_Report(TRUE)]
>      string BuildVersion;
>     [SMS_Report(TRUE)]
>      string ImagedDate;
>     [SMS_Report(TRUE)]
>      string Domain;
>     [SMS_Report(TRUE)]
>      string AddStatus;
>     [SMS_Report(TRUE)]
>      string JoinTime;
>     [SMS_Report(TRUE)]
>      string JoinVersion;
> };
>
> #pragma namespace ("\\\\.\\root\\cimv2")
> #pragma deleteclass("CCCImageDetails",NOFAIL)
> [DYNPROPS]
> class CCCImageDetails
> {
>    [key]string Keyname="";
>     string BuildDate;
>     string BuildType;
>     string BuildVersion;
>     string ImagedDate;
>     string Domain;
>     string AddStatus;
>     string JoinTime;
>     string JoinVersion;
> };
> [DYNPROPS]
> instance of CCCImageDetails
> {
>    KeyName = "KeyNames";
>
> [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CCCImageDetails|Build
> Date"),
>          Dynamic, Provider("RegPropProv")]BuildDate;
>
> [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CCCImageDetails|Build
> Type"),
>          Dynamic, Provider("RegPropProv")]BuildType;
>
> [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CCCImageDetails|Build
> Version"),
>          Dynamic, Provider("RegPropProv")]BuildVersion;
>
> [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CCCImageDetails|Imaged
> Date"),
>          Dynamic, Provider("RegPropProv")]ImagedDate;
>
> [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CCCImageDetails|Domain
> "),
>          Dynamic, Provider("RegPropProv")]Domain;
>
> [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CCCImageDetails|AddSta
> tus"),
>          Dynamic, Provider("RegPropProv")]AddStatus;
>
> [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CCCImageDetails|JoinTi
> me"),
>          Dynamic, Provider("RegPropProv")]JoinTime;
>
> [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CCCImageDetails|JoinVe
> rsion"),
>          Dynamic, Provider("RegPropProv")]JoinVersion;
> };
> // -- End of CCCImageDetails --
>
> The following is the vbscript that sms runs on the client.
>
> Option explicit
> '#########################################################################
> ' NAME: SMS MOF Update
> '
> ' AUTHOR: Steve Adams
> ' DATE  : 22/06/2004
> '
> ' COMMENT:  Force SMS Advanced clients to update the WMI Namespace
> '   from the SMS Site(s) master mof file SMS_DEF.MOF
> '   The file is stored in:
> '   <SMSServer>\CAP_<SITECODE>\CLIFILES.BOX\HINV\SMS_DEF.MOF
> '
> '   e.g. SMSSERVER01\CAP_SMS\CLIFILES.BOX\HINV\SMS_DEF.MOF
> '
> '   NOTE:  We are assuming that the legecy client access point is
> '     located on the same server as the site managment point.
> '     It is also assumed that the local clients assigned site
> '     has a managment point and client access point.
> '#########################################################################
>
>
> '##########################################################################
> ' Declare varaiables
> Dim objSMSClient 'SMS local Client Object
> Dim SMSMP   'Local SMS Clients Management point
> Dim SMSSite   'Local SMS Clients Assigned Site
> Dim objShell  'Scripting Shell Object
> Dim objMofComp  'Execute command for Mofcomp
> Dim objApplet  'Local SMS Client Applet Object
> Dim actions   'Actions list of SMS Client Applet Object
> Dim action   'Action within Acxtions list
>
> '##########################################################################
> 'Start of script
> On Error Resume Next
>
> '----------------------------------------
> 'Create local SMS Client Object
> '----------------------------------------
> set objSMSClient = CreateObject ("Microsoft.SMS.Client")
> if Err.Number<>0 then
> wscript.echo "Could not create SMS Client Object - quitting"
> WScript.Quit(2)
> end If
>
> '----------------------------------------
> 'Return Local SMS Client Managment Point and Assigned Site
> '----------------------------------------
> SMSMP = objSMSClient.GetCurrentManagementPoint
> SMSSite = objSMSClient.GetAssignedSite
>
> 'Debug
> 'wscript.echo "Current Management Point is : " &
> objSMSClient.GetCurrentManagementPoint
> 'wscript.echo "Assigned Site is : " & objSMSClient.GetAssignedSite
> set objSMSClient=Nothing
>
> '----------------------------------------
> 'Execute mofcomp on local client
> '----------------------------------------
> 'Run mofcomp on local client using site master mof file.
> Set objShell   = Wscript.CreateObject("Wscript.Shell")
> set objMofComp = objShell.Exec("mofcomp \\" & SMSMP & "\CAP_" & SMSSite &
> "\CLIFILES.BOX\HINV\SMS_DEF.MOF")
>
> 'Debug
> 'Results = objMofComp.StdOut.readall()
> 'WScript.Echo Results
>
> 'If mofcomp does not return an exit code of 0 then exit with error number 
> 3
> If objMofComp.exitcode <> 0 Then
> WScript.Quit(3)
> End If
>
> '----------------------------------------
> ' Now Trigger a hardware Inventory on the local client.
> '----------------------------------------
> Set objApplet = CreateObject("CPAPPLET.CPAppletMgr")
> Set actions = objApplet.GetClientActions
> For Each action In actions
>   If Instr(action.Name,"Hardware Inventory") > 0 Then
>      action.PerformAction
> End if
> Next
> ----------------------------------------------------------------------------
> -------------------------------------
>
>
> 


Relevant Pages

  • Previously Functioning Date Interpreter Now Failing
    ... Dim Entry As String ... Dim Result As String ... Dim ClientElement As Variant 'Holds the extracted Client Number ... ElseIf IsNumeric= False _ ...
    (microsoft.public.excel.programming)
  • RE: Previously Functioning Date Interpreter Now Failing
    ... Dim Entry As String ... Dim Result As String ... Dim ClientElement As Variant 'Holds the extracted Client Number ... ElseIf IsNumeric= False _ ...
    (microsoft.public.excel.programming)
  • Using Visual Basic NET to Access Terminal Services Session and Client Information
    ... It also accesses the Client Information for the client which executes this program on a Terminal Services Server. ... Dim pWinStationName As String ' integer LPTSTR - Pointer to a null-terminated string containing the name of the WinStation for this session ...
    (microsoft.public.windows.terminal_services)
  • Re: MAC Address
    ... Also, note that it is easy to read the MAC addresses on the computer on which the code resides, but the server cannot read the MAC address of the client unless there is a program that reads this information on the client and passes it to the server. ... Dim pWinStationName As String ' integer LPTSTR - Pointer to a null-terminated string containing the name of the WinStation for this session ... ByVal SessionId As Int32, ByVal WTSInfoClass As Int32, ByRef ppBuffer As String, ByRef pCount As Int32) As Boolean ...
    (microsoft.public.windows.terminal_services)
  • Re: Authenticating to a service
    ... service and our remote client application calls the authenticate method ... ''' Authenticate a user against the network's users. ... Public Shared Function Authenticate(ByVal userName As String, ... Dim tokenHandle As New IntPtr ...
    (microsoft.public.dotnet.languages.vb)