Friday, December 28, 2012

Error in PXE Role uninstallation


Error : Unable to delete PXE Role in sccm,

Solution :
Run following sql query in sccm Database.


delete from pkgservers where NALPATH like '%\\sccm server name\smspxeimages$%'
delete from pkgstatus where pkgserver like '%\\sccm server name\smspxeimages$%'

After this, we can able to delete PXE role.

Thursday, December 13, 2012

SCCM Report to collect video file information

collecting video file information using SCCM Report



1) add video file extension in inventory collection under software Inventory client agents properties as shown below.

once added all required extension in inventory collection, run software inventory client agent on all systems.

2) Create SCCM Report now, ( i used SQL Server Business intelligence studio configured already)

 In solution explorer, right click -> Reports -> Add new report


 Next


Next

Copy SQL Query into : query string and click on Query Builder ( sql query available below )

SQL Query : 

SELECT     SYS.Netbios_Name0 AS 'System Name', SYS.User_Name0 AS 'User Name', SF.FileName, SF.FilePath, SF.FileSize AS 'FileSize(Byte)', SF.FileModifiedDate,
FCM.CollectionID
FROM         v_GS_SoftwareFile AS SF INNER JOIN
v_R_System AS SYS ON SF.ResourceID = SYS.ResourceID INNER JOIN
v_FullCollectionMembership AS FCM ON FCM.ResourceID = SYS.ResourceID
WHERE     (SF.FileName LIKE '%.avi%'
or sf.filename like '%.3gp'
or sf.filename like '%.flv'
or sf.filename like '%.mov'
or sf.filename like '%.mp4'
or sf.filename like '%.mpg'
or sf.filename like '%.mpeg'
or sf.filename like '%.wmv'
or sf.filename like '%.divx'
or sf.filename like '%.mkv') AND (FCM.CollectionID = @CollectionID)
ORDER BY 'FileSize(Byte)'


Select check box : CollectionID and enter OK

Select CollectionID check box 
Enter the name of the Report

OUTPUT : 

Any help required : prakaash2109@gmail.com

Saturday, December 8, 2012

Uninstall uTorrent Completely using command line

How to uninstall uTorrent Completely from system.


1) open notepad and type following command.


cd "C:\Program Files\uTorrent"
uTorrent.exe /uninstall /s
rmdir /s /q "C:\Program Files\uTorrent"
reg delete HKEY_CURRENT_USER\software\BitTorrent /f
reg delete HKEY_CURRENT_USER\software\BitTorrent\uTorrent /f
reg delete HKEY_CLASSES_ROOT\.torrent /f
reg delete HKEY_CLASSES_ROOT\Applications\uTorrent.exe /f
reg delete HKEY_CLASSES_ROOT\uTorrent /f
reg delete HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run /v uTorrent /f

save as batch file ( .bat ) and run. it removes uTorrent completely from your system.

same batch file we can create package through SCCM and distribute via software distribution.



Thursday, November 29, 2012

SCCM Software update point error ( Error = 0*80004005)





ERROR : Failed to add update source for wuaagent, group policy error.



Solution :
Deleted registry.pol  from : c:\windows\system32\grouppolicy\machine\registry.pol.




Now initiate software update scan cycle and software deployment scan cycle.


Now verify. Wuahandler.log, log file will show “Async searching of updates using WUAgent started.”

Wednesday, November 28, 2012

Asset Information with username in SCCM

Asset Information with username in SCCM


Create a new report with following SQL query : 



select  distinct
    R.ResourceID,
    R.User_Name0,
    R.Netbios_Name0 AS 'Computer_Name',
    R.Resource_Domain_OR_Workgr0 AS 'Domain_workgroup',
    S.SiteName as 'SMSSiteName',
    OS.Caption0 AS 'OperatingSystem',
    OS.CSDVersion0 AS 'ServicePackLevel',
    SEQ.SerialNumber0 AS 'SerialNumber',
    SEQ.SMBIOSAssetTag0 AS 'AssetTag',
    CS.Manufacturer0 AS 'Manufacturer',
    CS.Model0 AS 'Model',
    WS.LastHWScan AS 'Last_Scan_Date',
    RAM.TotalPhysicalMemory0 AS 'Memory_KBytes',
    Pro.NormSpeed0 AS 'Processor_GHz',
    (Select sum(LD.Size0) from v_GS_LOGICAL_DISK LD where LD.ResourceID = R.ResourceID) As 'DiskSpace_MB',
    (Select sum(LD.FreeSpace0) from v_GS_LOGICAL_DISK LD where LD.ResourceID = R.ResourceID) As 'Free_Disk_Space_MB',
    U.Full_User_Name0
  from
    dbo.v_R_System_Valid R
    inner join dbo.v_GS_OPERATING_SYSTEM OS on (OS.ResourceID = R.ResourceID)
    inner join dbo.v_GS_WORKSTATION_STATUS WS on (WS.ResourceID = OS.ResourceID)
    inner join dbo.v_GS_SYSTEM_ENCLOSURE_UNIQUE SEQ on (SEQ.ResourceID = R.ResourceID)
    inner join dbo.v_GS_COMPUTER_SYSTEM CS on (CS.ResourceID = R.ResourceID)
    inner join dbo.v_GS_X86_PC_MEMORY RAM on (RAM.ResourceID = R.ResourceID)
    inner join dbo.v_GS_PROCESSOR Pro on (Pro.ResourceID = R.ResourceID)
    inner join dbo.v_FullCollectionMembership FCM on (FCM.ResourceID = R.ResourceID)
    inner join dbo.v_Site S on (FCM.SiteCode = S.SiteCode)
    left outer join dbo.v_R_User U on U.Unique_User_Name0 = R.User_Domain0+'\'+R.User_Name0
--    inner join v_GS_LOGICAL_DISK LD on (v_GS_LOGICAL_DISK.ResourceID = R.ResourceID) and LD.DeviceID0=SUBSTRING(OS.WindowsDirectory0,1,2)
--    left join v_GS_SYSTEM_CONSOLE_USAGE_MAXGROUP SCUM on (SCUM.ResourceID = R.ResourceID)
 Where
    FCM.CollectionID = @CollectionID
Order by
    R.Netbios_Name0

Create Prompt value for Collection : 


Prompt SQL Statement : 



begin
if (@__filterwildcard = '')
select CollectionID, Name from v_Collection order by Name
else
select CollectionID, Name from v_Collection
WHERE CollectionID like @__filterwildcard
order by Name
end






Tuesday, October 16, 2012

Office 2010 Installation Using SCCM

                                Office 2010 Installation using SCCM

1) Customize Office setup file.

  1. To customize Office Setup, use the command line setup.exe /admin to start the Office Customization Tool. In this example (using Configuration Manager 2007 to deploy the Office Professional Plus 2010), at a command prompt, run setup.exe /admin from the package source directory, \\SCCM\Office2010\Professional.
  2. CMD -> office setup file path -> setup.exe /admin, will open console shown in below.

    Verify Edition of Office & OK.


    Office customization page..


    1. To ensure that Office Professional Plus 2010 is silently installed, modify and configure the settings as follows:
      1. In the Licensing and user interface dialog box, set the Display Level to None, which will then enable the Suppress modal check box.
      2. Verify that the Completion notice and No Cancel options are not selected.
      3. Enter a valid 25-character volume license key in the Product Key box that is located under Licensing and user interface.
      4. Select the I accept the terms in the License Agreement check box.
    2. Save and name the newly created .msp file, and then put it in the \Updates folder for Office Professional Plus 2010 on the computer that contains the package source directory, which in this example is \\SCCM\Office2010\Professional\Updates\CustomFileOffice2010SilentInstall.MSP.

      Use this setup file for roll-out using SCCM.

      2) Create Package :


      To create a package
      1. To create a package, in the Configuration Manager Console, navigate to System Center Configuration Manager / Site Database / Computer Management / Software Distribution / Packages.
      2. Right-click Packages, point to New, and then click Package.
      3. In the General dialog box of the New Package Wizard, enter the Name, Version, Manufacturer, and Language. For example, Office, 2010, Microsoft, English (US).
      4. In the Data Source dialog box, select This package contains source files. Click the Set button, and then enter the path for the location of the source files in the Source directory field. For this example, select the source directory location of the local drive, such as C:\Office2010\Professional, which contains a copy of the Office Enterprise 2007 installation CD.
      5. Click OK, and then continue to click Next and accept the default settings in all of the following dialog boxes: Data AccessDistribution SettingsReporting, and Security. In the Wizard Completed dialog box, click Close.
      The package, in this example named Microsoft Office 2010 English (US), is now created. The next step is to create a Configuration Manager 2007 program, which will contain the setup and installation parameters for the Office Professional Plus 2010.

      Create a program that has setup and install parameters for Office 2010

      This example provides the steps to create a program for the deployment of a silent installation of Office Professional Plus 2010, where the users do not interact with the installation process.

      To create a program for the package

      1. To create a program for the Office 2010 package, right-click Programs, point to New, and then click Program.
      2. In the General dialog box, enter a name for the package in the Name field, which in this example is named Office 2010 silent installation. In the Command line field, in this example type setup.exe. Because the customization file, CustomFileOffice2010SilentInstall.MSP, was put in the \Updates folder, a command-line option is not needed to reference its location. For more information, see Setup command-line options for Office 2010. In the Run field, click the drop-down menu, and then select Hidden. In theAfter running field, verify the default of No action required is selected. Click Next and accept the defaults in the Requirements dialog box.
      3. In the Environment dialog box, click the Program can run drop-down box and select Whether or not a user is logged on. This will enable Run with administrative rights for the Run mode. Leave the default for Drive mode to Runs with UNC name, and then click Next.
      4. In the Advanced dialog box, select the Suppress program notifications check box, and then click Next.
        note Note:
        If you want users to be aware of the installation by way of a notification on their desktop computers, do not select Suppress program notifications.
      5. In the Windows Installer dialog box, click Import, and then browse to the directory that contains the EnterpriseWW.msi file, which in this example is \\SCCM\Office2010\Professional\ProPlus.WW\ProPlusWW.msi. After selecting the .msi file, the Windows Installer product code and Windows Installer file fields are populated with the corresponding information associated with the selected .msi file. Click Next, and accept the default values in the MOM Maintenance Mode dialog box.
      6. To view the Summary dialog box, click Next. To finish the process of creating the new program, click Next, which will then display the Wizard Completed dialog box. To exit from the New Program Wizard, click Close.
      The next step is to select a distribution point for the package.

      Select a distribution point


      To use a server as a distribution point for providing packages to distribute packages to the client computers, you must first designate a site system as a distribution point. In this example, the single site server, named SCCM, was initially configured as both a management point and a distribution point.
      To select a distribution point
      1. To select a distribution point for the newly created package Microsoft Office 2010 English (US), right-click Distribution Points, click New Distribution Points, click Next, and then click the check box for the distribution point (in this example, SCCM). Click Next.
      2. Upon completion of the New Distribution Points Wizard, click Close.
      The next step is to advertise the package, Microsoft Office 2010 English (US), which now contains both the Configuration Manager 2007 distribution point and program information for deploying a silent installation of Office Professional Plus 2010. Before advertising the package, you should first verify that it was installed on the distribution point.
      For more information about how to verify the status of a package, see How to View the Status of a Package (http://go.microsoft.com/fwlink/p/?LinkId=145898).

      Create an advertisement of Office 2010 package

      This example provides the steps to create an advertisement of the Office Professional Plus 2010 package.
      To create an advertisement of the package
      1. To create an advertisement, right-click Advertisements, point to New, and then click Advertisement. In the General dialog box of the New Advertisement Wizard, in Namefield, enter Office 2010. Click the Browse button for the Package field, and then click on the package that you want to advertise, which in this example is Microsoft Office 2010 English (US). Click OK. Click the Browse button for the Collection field, click on the collection, which in this example is Target-Computers, click OK, and then click Next.
      2. In the Schedule dialog box, enter the date and time in the Advertisement start time fields for when the advertisement will be available, and then click the asterisk button for Mandatory Assignments.
      3. In the Assignment Schedule dialog box, click the Schedule button, and then enter the same date and time that you previously entered in the Advertisement start timefields in the Schedule dialog box. To return to the Schedule dialog box, click OK.
      4. In the Schedule dialog box, select the check boxes for Enable Wake On LANIgnore maintenance windows when running program, and Allow system restart outside maintenance windows, and then click Next.
        note Note:
        In your production environment, there might be policies in place that would require different selections than previously listed for the assignment schedule. For information about these options, see Advertisement Name Properties: Schedule Tab (http://go.microsoft.com/fwlink/p/?LinkId=145900).
      5. Accept the default values on the Distribution PointsInteractionSecurity, and Summary dialog boxes. Upon successful completion of the New Advertisement Wizard, click Close in the Wizard Completed dialog box.
      The package will now be advertised to the targeted collection and the silent installation of Office Professional Plus 2010 will begin.
      For information about how to monitor the status of the advertisement, see How to View the Status of an Advertisement (http://go.microsoft.com/fwlink/p/?LinkId=145901).


Monday, September 24, 2012

HP Warranty Information in the SCCM Hardware Inventory -( Worth Reading )


This process is dependent on the output from an HP web site.  If HP updates the format of the output from the site, it could affect the processing of the data.  also, this configuration assumes that the script running under system credentials as an SCCM program has access to the HP site.  If proxy or any other type of credentials are required for internet access, this process may not work without modifications for the environment.
The script is below.  You will want to change the ComapnyName reference to your company name.  This value will be used later as well.
EnableLogging = True

sCompanyName = "CompanyName"

Set oShell = CreateObject("wscript.Shell")
Set fso = CreateObject("scripting.filesystemobject")

If EnableLoggingThen
    Set oLogFile = fso.OpenTextFile("C:\Windows\Temp\WarrantyInfo.log", 8, True)
    oLogFile.WriteLine"*********************************************************"
EndIf

WriteLog"Beginning warranty information lookup."

sWebServiceHost = "http://h20000.www2.hp.com/bizsupport/TechSupport"
sWebServiceURL = "WarrantyResults.jsp"
sWebService = sWebServiceHost & "/" & sWebServiceURL

'Get the system's serial number from WMI
Set oWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colItems = oWMIService.ExecQuery("Select SerialNumber from Win32_BIOS",,48)
ForEach objItemin colItems
    sSerialNumber = objItem.SerialNumber
Next

WriteLog"Serial number of system is " & sSerialNumber

'Get the Product ID from WMI
Const wbemFlagReturnImmediately = 16
Const wbemFlagForwardOnly = 32
lFlags = wbemFlagReturnImmediately + wbemFlagForwardOnly
strService = "winmgmts:{impersonationlevel=impersonate}//./root/HP/InstrumentedBIOS"
strQuery = "select * from HP_BIOSSetting"
Set objWMIService = GetObject(strService)
Set colItems = objWMIService.ExecQuery(strQuery,,lFlags)
sProductNumber = ""
ForEach objItemIn colItems
    If objItem.Name = "SKU Number"Then
        sProductNumber = objItem.Value
    EndIf
    If objItem.Name = "Product Number"Then
        sProductNumber = objItem.Value
    EndIf
Next

IfLen(sProductNumber) = 0Then
    WriteLog"ERROR: Product Number could not be determined."
    oLogFile.WriteLine"*********************************************************"
    oLogFile.Close
    WScript.Quit(9)
Else
    WriteLog"Product number of the system is " & sProductNumber
EndIf

Set colItems = oWMIService.ExecQuery("Select AddressWidth from Win32_Processor",,48)
ForEach objItemin colItems
    sAddressWidth = objItem.AddressWidth
Next

WriteLog"Operating system is " & sAddressWidth & " bit."

'Define the parameters string to send to the web site
sParameters = "nickname=&sn=" & sSerialNumber & "&country=US&lang=en&cc=us&pn=" & sProductNumber & "&find=Display+Warranty+Information+%C2%BB&"

WriteLog"Opening the web site URL " & sWebService & "?" & sParameters

'Define and call the web site
Set oHTTP = CreateObject("Microsoft.xmlhttp")
oHTTP.open"GET", sWebService & "?" & sParameters, False
'oHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
oHTTP.send

If oHTTP.Status = 200Then
    WriteLog"Successful response from the web site."
    'WriteLog oHTTP.ResponseText
    Process oHTTP.ResponseText
Else
    WriteLog"ERROR: the web site returned status code " & oHTTP.Status
    WriteLog"Returning exit code 1."
    nExitCode = 1
EndIf

If EnableLoggingThen
    oLogFile.WriteLine"*********************************************************"
    oLogFile.Close
EndIf

WScript.Quit (nExitCode)

Function Process (HTML)
    WriteLog"Processing the HTML returned from the site."
    
    intSummaryPos = InStr(LCase(html), "serial number")
    
    If intSummaryPos = 0Then
        Process = ""
        ExitFunction
    EndIf
    
    intSummaryTable1Start = InStrRev(LCase(html), "<table", intSummaryPos)
    intSummaryTable1End = InStr(intSummaryPos, LCase(html), "</table>") + 8
    intSummaryTable2Start = InStr(intSummaryTable1End, LCase(html), "<table")
    intSummaryTable2End = InStr(intSummaryTable2Start, LCase(html), "</table>")
    
    table1 = getStr(intSummaryTable1Start, intSummaryTable1End, html)
    table2 = getStr(intSummaryTable2Start, intSummaryTable2End, html)
    
    const HKLM = &H80000002
    Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")

    sKeyPath = "SOFTWARE\" & sCompanyName & " \WarrantyInformation"
    
    WriteLog"Registry key path is HKLM\" & sKeyPath
    
    oReg.CreateKey HKLM,sKeyPath

    WriteLog"Processing the first table from the web  page."
    arrGeneral = processTables(table1,1)   
    'arrGeneal should be in the form Serial Number, Product Number, Product Line, Product Description, Warranty Check Date
    
    WriteLog"Processing the second table from the web  page."    
    arrContracts = processTables(table2,2)
    'arrContracts should be in the format Warranty Type, HW Warrenty Start Date, HW Warranty End Date, HW Warranty Status, Setup Warranty Start Date, Setup Warranty End Date, Setup Warranty Status
    WriteLog"Setting registry values."
    WriteLog"SerialNumber is " & arrGeneral(0)
    oReg.SetStringValue HKLM, sKeyPath, "SerialNumber", arrGeneral(0)
    WriteLog"ProductNumber is " & arrGeneral(1)
    oReg.SetStringValue HKLM, sKeyPath, "ProductNumber", arrGeneral(1)
    WriteLog"SerialLine is " & arrGeneral(2)
    oReg.SetStringValue HKLM, sKeyPath, "ProductLine",  arrGeneral(2)
    WriteLog"SerialDescription is " & arrGeneral(3)
    oReg.SetStringValue HKLM, sKeyPath, "ProductDescription",  arrGeneral(3)
    WriteLog"WarrantyCheckDate is " & CStr(CDate(arrGeneral(4)))
    oReg.SetStringValue HKLM, sKeyPath, "WarrantyCheckDate",  CStr(CDate(arrGeneral(4)))
    WriteLog"WarrantyType is " & arrContracts(0)
    oReg.SetStringValue HKLM, sKeyPath, "WarrantyType", arrContracts(0)
    WriteLog arrContracts(1)
    WriteLog"HardwareWarrantyStartDate is " & CStr(CDate(arrContracts(1)))
    oReg.SetStringValue HKLM, sKeyPath, "HardwareWarrantyStartDate", CStr(CDate(arrContracts(1)))
    WriteLog"HardwareWarrantyEndDate is " & CStr(CDate(arrContracts(2)))
    oReg.SetStringValue HKLM, sKeyPath, "HardwareWarrantyEndDate", CStr(CDate(arrContracts(2)))
    
EndFunction

Function getStr(startpos, endpos, data)
    Dim tmp
    'Get the substring
    tmp = Mid(data, startpos, endpos - startpos)
    ' Remove end of line
    tmp = Replace(Replace(Replace(tmp, VbCrLf, ""), vbCr, ""), vbLf, "")
    getStr = tmp
EndFunction

Function processTables(table, ttype)
    
    ' Remove HTML Tags and replace with "|"
    Set re = NewRegExp
    re.Pattern = "<[^>]+>"
    re.IgnoreCase = True
    re.Global = True
    table = re.Replace(table, "|")
    
    table = Replace(table, "&nbsp;", "")
    table = Replace(table, ":", "")
    table = Replace(table, "  ", "")
    
    ' Remove excess |
    re.Pattern = "[|]+"
    table = re.Replace(table, "|")
    
    ' Clean up a bit more
    re.Pattern = "\|\s+\|"
    table = re.Replace(table, "|")
    
    ' Remove | from start and end of string
    re.Pattern = "^\||\|$"
    table = re.Replace(table, "")
    
    arrTable = Split(table, "|")
    arrTmp = ""
    
    If ttype = 1Then' General Info Table
        i = 1
        ForEach cellin arrTable
            SelectCaseLCase(Trim(cell))
                Case"serial number"
                    sSerialNumber = arrTable(i)
                Case"product number"
                    sProductNumber = arrTable(i)
                Case"product line"
                    sProductLine = arrTable(i)
                Case"product description"
                    sProductDescription = arrTable(i)
                Case"date of warranty check"
                    sCheckDate = arrTable(i)
            EndSelect
            i = i + 1
        Next
        arrTmp = sSerialNumber & "|" & sProductNumber & "|" & sProductLine & "|" & sProductDescription & "|" & sCheckDate
    ElseIf ttype = 2Then' Contract Info
        i = 0
        ForEach cellin arrTable
            cell = Replace(cell,"                                   ","")
            SelectCaseLCase(Trim(cell))
                Case"warranty type"
                    sWarrantyType = arrTable(i+8)
                Case"wty hp hw maintenance onsite support"
                    sHWStartDate = arrTable(i+1)
                    sHWEndDate = arrTable(i+2)
                    sHWStatus = arrTable(i+3)
                Case"wty hp hw maintenance offsite support"
                    sHWStartDate = arrTable(i+1)
                    sHWEndDate = arrTable(i+2)
                    sHWStatus = arrTable(i+3)
                Case"wty hp support for initial setup"
                    sISStartDate = arrTable(i+1)
                    sISEndDate = arrTable(i+2)
                    sISStatus = arrTable(i+3)
            EndSelect
            i = i + 1
        Next
        arrTmp = sWarrantyType & "|" & sHWStartDate & "|" & sHWEndDate & "|" & sHWStatus & "|" & sISStartDate & "|" & sISEndDate & "|" & sISStatus
    EndIf
    ' Remove | from start and end of string
    re.Pattern = "^\||\|$"
    arrTmp = re.Replace(arrTmp, "")
    'wscript.echo arrTmp
    arrResult = Split(arrTmp, "|")
    
    Set re = Nothing
    
    processTables = arrResult
EndFunction

Function WriteLog (sText)
    If EnableLoggingThen
        oLogfile.WriteLineNow() & "     " & sText
    EndIf
EndFunction

The script logs its results to C:\Windows\Temp\WarrantyInfo.log.

And the information is stored in the registry.

In order to get this information into the SCCM database, we have to modify the Configuration.mof found in C:\Program Files(x86)\Microsoft Configuration Manager\inboxes\clifiles.src\hinv.  (The path may be different depending on where SCCM is installed on the site server.)  Open Configuration.mof, scroll to the bottom and add (making sure to change the references to CompanyName to whatever value you used in the vbscript above):
//=====================================================================
// Warranty Information
//=====================================================================
[DYNPROPS]
class HP_WarrantyInfo
{
 [key] string        Keyname="";
       string        HardwareWarrantyEndDate;
       string        HardwareWarrantyStartDate;
       string        ProductDescription;
       string        ProductLine;
       string        ProductNumber;
       string        SerialNumber;
       string        WarrantyCheckDate;
       string        WarrantyType;
};
[DYNPROPS]
instance of HP_WarrantyInfo
{
     KeyName="WarrantyInformation";
     [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CompanyName\\WarrantyInformation|HardwareWarrantyEndDate"), Dynamic, Provider("RegPropProv")] HardwareWarrantyEndDate;
     [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CompanyName\\WarrantyInformation|HardwareWarrantyStartDate"), Dynamic, Provider("RegPropProv")] HardwareWarrantyStartDate;
     [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CompanyName\\WarrantyInformation|ProductDescription"), Dynamic, Provider("RegPropProv")] ProductDescription;
     [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CompanyName\\WarrantyInformation|ProductLine"), Dynamic, Provider("RegPropProv")] ProductLine;
     [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CompanyName\\WarrantyInformation|ProductNumber"), Dynamic, Provider("RegPropProv")] ProductNumber;
     [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CompanyName\\WarrantyInformation|SerialNumber"), Dynamic, Provider("RegPropProv")] SerialNumber;
     [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CompanyName\\WarrantyInformation|WarrantyCheckDate"), Dynamic, Provider("RegPropProv")] WarrantyCheckDate;
     [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CompanyName\\WarrantyInformation|WarrantyType"), Dynamic, Provider("RegPropProv")] WarrantyType;
};
Now SCCM will pick up our Warranty information from the registry and add it to the database.  Now we need to get the script to run on the HP systems in the environment.  Create a package and program for the vbscript above and advertise it to a collection.  In order to populte the collection, we have several methods.  We could use standard query rules to get all systems where the manufacturer is HP, but I decided to use DCM instead.
We need a collection of all of our HP systems, so create a collection called HP Systems with a membership rule of:
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.Manufacturer in ("Hewlett-Packard","HP","HPQOEM")
In the SCCM Console, go to Desired Configuration Management > Configuration Items  and create a new General Configuration Item named Warranty Information and click Next.

Click Next on Objects.
On Settings, select New | Registry

Since the whole purpose of this exercise is to gather warrany information, we are going to look for the HardwareWarrantyEndDate registry key created by our vbscript.  Seth the display name to HardwareWarrantyEndDate, Hive to HKEY_LOCAL_MACHINE, Key to SOFTWARE\CompanyName\WarrantyInformation (again change CompanyName to the value used in the script) and Value name to HardwareWarrantyEndDate.  Click OK to close the New Registry Setting Properties window.

Click Next through the remaining screens in the wizard to complete the creating of the configuration Item.
Now that we have a configuration item to determine if the registry key exists, we need to create a baseline.  Go to Desired Configuration Management > Configuration Baseline and create a new baseline called 'Warranty Information Baseline' and click Next.

Click 'applications and general' and select the Warranty Information configuration item.

Click Next through the remaining screens in the wizard to complete the creating of the configuration baseline.
Right-click the configuration baseline and select 'Assign to a Collection'.
Verify that the Warranty Information Baseline has been added and click Next.
Click Browse and select the HP Systems collection created earlier.
Determine how often you want this baseline to be evaluated, set the schedule and click Next.  The default value of every 7 days should be fine.
Click Next through the remaining screens in the wizard to complete the assignment of the configuration baseline.
Now that we have a baseline and it is assigned, we will begin getting compliance data back.  We can use this compliance data to create a collection of systems that do not have warranty information stored in the registry.
Right -click the 'Warranty Information Baseline' and select Create New Collection > Non-Compliant Systems and select the defaults through the wizard.
You can now use this collection to advertise the Warranty Information script.  Systems that are non-compliant will run the script to populate the registry with the warranty information, therefore becoming compliant and being removed from the collection.
Once the information is in the registry and a hardware inventory cycle is run, you can see the inventory information in Resource Explorer.

Ref : http://adminnexus.blogspot.in/2012/09/including-hp-warranty-information-in.html