This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Query Install Errors & Update Errors

Using T-SQL, I'd like to be able to query "Install Errors"  and seperately "Update Errors" so that I can easily group computers with similar errors.  For example:  I'd like to pull a list of computers that "need a restart" as an Update error.

Thanks!

:21517


This thread was automatically locked due to age.
Parents
  • HI,

    Interms of a SQL query to get machines that have an outstanding reboot required message the following should get you going:

    SELECT distinct c.Name FROM Errors as e with (nolock)
    inner join ComputersAndDeletedComputers as c with (nolock)
    on c.ID=e.ComputerID
    where 
    e.Source = 'ALC' 
    and e.number = 109
    and e.Outstanding = 1

     As Reboot Required has a code in SEC as 6D, which is 109 decimal.  

    As for those machines with install errors.  There is a filter in SEC called "Computers with installation errors".  This eventually calls the SQL function: 'ComputerListWithInstallErrors]', you can look at the SQL in that and the conditions really boil down to those below:

    SELECT distinct c.Name FROM ComputersAndDeletedComputers as c with (nolock)
    		     WHERE c.InstallFailureReason <> 0
                   AND c.InstallFailureReason <> -2

    As for Updating errors specifically. You can use the first SQL query with a minor change... 71 and 6b are the common errors so... 71 = 113 dec and 6b = 107, making the query:


     

    SELECT distinct c.Name FROM Errors as e with (nolock)
    inner join ComputersAndDeletedComputers as c with (nolock)
    on c.ID=e.ComputerID
    where 
    e.Source = 'ALC' 
    and (e.number = 113 or e.number=107)
    and e.Outstanding = 1

     Hope these get you going.

    It's worth mentioning that you can do a Ctrl-C/Ctrl-V on the computer list view to get a report if what you see is in view.

    Regards,

    Jak

    :21521
Reply
  • HI,

    Interms of a SQL query to get machines that have an outstanding reboot required message the following should get you going:

    SELECT distinct c.Name FROM Errors as e with (nolock)
    inner join ComputersAndDeletedComputers as c with (nolock)
    on c.ID=e.ComputerID
    where 
    e.Source = 'ALC' 
    and e.number = 109
    and e.Outstanding = 1

     As Reboot Required has a code in SEC as 6D, which is 109 decimal.  

    As for those machines with install errors.  There is a filter in SEC called "Computers with installation errors".  This eventually calls the SQL function: 'ComputerListWithInstallErrors]', you can look at the SQL in that and the conditions really boil down to those below:

    SELECT distinct c.Name FROM ComputersAndDeletedComputers as c with (nolock)
    		     WHERE c.InstallFailureReason <> 0
                   AND c.InstallFailureReason <> -2

    As for Updating errors specifically. You can use the first SQL query with a minor change... 71 and 6b are the common errors so... 71 = 113 dec and 6b = 107, making the query:


     

    SELECT distinct c.Name FROM Errors as e with (nolock)
    inner join ComputersAndDeletedComputers as c with (nolock)
    on c.ID=e.ComputerID
    where 
    e.Source = 'ALC' 
    and (e.number = 113 or e.number=107)
    and e.Outstanding = 1

     Hope these get you going.

    It's worth mentioning that you can do a Ctrl-C/Ctrl-V on the computer list view to get a report if what you see is in view.

    Regards,

    Jak

    :21521
Children
No Data