locked
query for specific registry key RRS feed

  • Question

  • hi all,

    could someone,help me on how to query sms DB about specific registry key.

    i need to create collection based on this query:

    all machines that have on the HKLM\software\microsoft\sms\mobile client\software distribution\execution history\system path a specific package ID entry.

    Sunday, February 13, 2011 2:39 PM

Answers

All replies

  • hi,

    I don't think it's possible to create that kind of Collection, what exactly do you need to find on those machines?


    MCSA | MCTS - SCCM 2007
    Sunday, February 13, 2011 2:50 PM
  • Hi George,

    thanks for your quick reply.

    I need to report all machines that have that registry key.

    regards.

    Sunday, February 13, 2011 2:55 PM
  • Hi,

    You have two options

    1) Extend the inventory files (sms_def.mof and configuration.mof), an exemple is provided here - http://blog.coretech.dk/kea/how-to-get-registry-information-into-hardware-inventory/

    2) You can use the DCM feature to create a registry rule for the specific package id. All clients with the package id wil be listed as compliant. an example is provided here - http://blog.coretech.dk/kea/using-software-distribution-and-desired-configuration-management-to-fix-non-compliant-computers/


    Kent Agerlund | My blogs: http://blog.coretech.dk/author/kea/ and http://scug.dk/ | Twitter @Agerlund | Linkedin: /kentagerlund
    • Proposed as answer by George Fr Sunday, February 13, 2011 3:02 PM
    • Marked as answer by Robinson Zhang Tuesday, March 1, 2011 7:51 AM
    Sunday, February 13, 2011 2:57 PM
  • Kent, Extending the inventory is a good idea ;) Thanks for useful link

    MCSA | MCTS - SCCM 2007
    Sunday, February 13, 2011 3:01 PM
  • There might be a 3<sup>rd</sup> option.

     

    That key is going to tell you what you have executed but that status messages within ConfigMgr might be able to tell you the same thing too. What are you trying to do?


    http://www.enhansoft.com/
    Sunday, February 13, 2011 4:05 PM
  • Jones,

    what is this option you are talking about.could you explain me please.

    thx

    Sunday, February 13, 2011 5:07 PM
  • All Advertisement details are returned to ConfigMgr, for example who install what, what is the last status message of the advert, etc..

    What are you trying to do? With this information, we can better understand how to help you.


    http://www.enhansoft.com/
    Sunday, February 13, 2011 5:24 PM
  • I want to deploy an sms package on all my domain clients.

    After trying on some test machines,i discover that some clients have that registry key,witch will prevent my sms package to be deployed succefuly.

    So,i want to report all my domain machines where this key is installed,in order to fix this issue.

    many thx in advance for all.

    Sunday, February 13, 2011 6:44 PM
  • Here's a thought.  That particular registry key, for that particular package within that key, simply means that the package has already been attempted to install, (possibly unsuccessfully) in the past.

    Instead of doing a hardware inventory or DCM to check that key, for the Advertisement itself, try changing the 'rerun' choice to "Always Rerun".  Additionally, you may (you may not, it depends upon the original advertisement settings) but you perhaps may need to set the mandatory start time to be a recurring, like "run every 7 days", or you need to add a 2nd mandatory start time to the list of start times within the advertisement.

    By modifying the rerun and mandatory start times, regardless of whether that regkey is set or not, the Advertisement properties of "rerun always" + the run times will mean that even if the regkey exists, the client will re-run the advertisement.

    ------------

    Additionally, this may not apply to your situation, but if your end goal is to re-run the advertisement only on machines which have previously failed, here's way to build a collection of only those machines.  And that is the collection you target with the now modified advertisement with additional mandatory times + rerun always:

    http://eskonr.com/2010/01/collection-based-on-advertisement-status/ 


    Standardize. Simplify. Automate.
    Sunday, February 13, 2011 7:28 PM
  • Yes, I think Sherry is on the right track here. The re-run setting should do what you need without having to inventory every PC.
    http://www.enhansoft.com/
    Sunday, February 13, 2011 9:47 PM
  • sorry  all,

    i think that i'm not explaining my need.

    in my domain,some clients have that key installed,for others not.so,before deplying my sms package,i want to report all machines with that key (witch prevent my package to be installed succefully) in order to limit my software distribution.

    sorry again.

    Monday, February 14, 2011 8:02 AM
  • Hello - I think, the best way is to create Conguration Item through DCM to find out the registry key.

    More details about CI

    Kent's http://blog.coretech.dk/kea/using-software-distribution-and-desired-configuration-management-to-fix-non-compliant-computers/

    Also see, technet article, http://technet.microsoft.com/en-us/library/bb694136.aspx


    Anoop C Nair
    • Proposed as answer by Felyjos Friday, July 19, 2019 5:43 PM
    Monday, February 14, 2011 8:07 AM
  • That registry key will list the packages installed on a PC, right?

    You want a list of PCs with a particular registry key, for example,  HKEY_LOCAL_MACHINE\SOFTWARE\ Microsoft\SMS\Mobile Client\Software Distribution\Execution History\System\ES100037, Right?

     

    I know that you want to install a package but how does inventorying that registry key help you? What are you going to do when you find PCs with that key? Delete the registry key?


    http://www.enhansoft.com/
    Monday, February 14, 2011 11:21 AM
  • "i think that i'm not explaining my need.

    in my domain,some clients have that key installed,for others not.so,before deplying my sms package,i want to report all machines with that key (witch prevent my package to be installed succefully) in order to limit my software distribution."

    I believe Garth & I understand your situation.  And inventorying (or doing a DCM compliant check) for that regkey will not help in the long run.  Because... think of it this way:

    1) you inventory or dcm check for that regkey.
    2) You use the results to create a collection to send out an advertisement to reg delete that key.
    3) The computers you want to re-run the package, "somehow" you get them to rerun the package.
    4) Those exact same computers now get that exact same package... and now that regkey exists again.  Which will again be inventoried or dcm checked to exist again.

    Do you see the endless loop?  Having that regkey about package execution history, and inventorying for it, will turn into you endless chasing your tail.  Unless there is something really, really wrong with your package, like you repackaged it in some horrible way that relies on that regkey...(I cannot think of how you might have done so, but wackier things have happened) deleting the regkey is not the answer.


    Standardize. Simplify. Automate.
    Monday, February 14, 2011 12:13 PM
  • Extend hardware inventory as Kent indicated.  Then you can create a query-based collection that will contain only the systems that have the registry key.
    Romano Jerez | http://NETvNext.com
    Monday, February 14, 2011 5:07 PM
  • I absolutely adore custom hardware inventory.  And am in love with DCM for everything under the sun.  So, that said… if *I’m* saying that hardware inventory and dcm is the absolutely wrong answer here… if you choose to go ahead and do a custom hinv or dcm CI… well, good luck to you.  I think it’s the absolutely wrong answer for this situation.
    Standardize. Simplify. Automate.
    Monday, February 14, 2011 7:58 PM
  • The problem is my package will be installed succefully when a machine doesn't have this key.

    So,what i want to do is just create a collection that contain all machines without that key and deploy my sms package,it's like limit my deploy to a sub set of machines.

    any suggestions.

    Regards.

    Wednesday, February 16, 2011 8:29 AM
  • The problem is my package will be installed succefully when a machine doesn't have this key.
    What's the reason for that? Is the package checking for the registry key itself or are there any conflicts when other software is installed? What happens if you try to install the software and the regkey is present?
    Torsten Meringer | http://www.mssccmfaq.de
    Wednesday, February 16, 2011 8:44 AM
  • that's right,there is a conflict with an old installed software,when i try to install the package and the regkey is present,i got a failed install message.
    Wednesday, February 16, 2011 9:07 AM
  • Look at Program Rerun behavior setting on an advertisement

    http://technet.microsoft.com/en-ca/library/bb694016.aspx

     

     

    Program rerun behavior

    Specifies whether the advertised program will be rerun on the client computer if it has previously been run before the scheduled mandatory time.

     

    Always rerun program: The program will always be rerun on the client when the advertisement is scheduled, even if the program has already been successfully run. This is particularly useful when using recurring advertisements in which the program is routinely updated, as with some virus detection software.


    http://www.enhansoft.com/
    Wednesday, February 16, 2011 11:44 AM
  • Please, for us... can't you just *try* setting the advertisement to target a collection of computers which currently 'fail' if the regkey is present, modify the adveritsement to "rerun always", and add another mandatory start time?  Please?


    Standardize. Simplify. Automate.
    Wednesday, February 16, 2011 11:49 AM
  • that's right,there is a conflict with an old installed software,when i try to install the package and the regkey is present,i got a failed install message.
    You could also use a tasksequence to install the softwarae (yes, even outside OSD). Just add a condition that the install will be skipped if that registry key (or even better: the software) is present.
    Or: create a new collection that excludes all computers where the conflicting software is installed on (given that it registers itself in add/remove programs or another location that's inventoried by default).


    Torsten Meringer | http://www.mssccmfaq.de
    Wednesday, February 16, 2011 1:06 PM
  • I'm beginning to think, perhaps, that they have "run another program first", for an old package, and they need to check the box to always rerun the parent package, when the end of the chain of package installs is the advertisement target.

    But... everything here is a guess.  Because we don't know what he is installing, or what the error message is.  Just that it fails. 

    What exactly are you installing?  How many steps?  Is it something packaged internally?  or installed via a custom script wrapper or cmd?  A Task Sequence?  1 program?  or several programs using "run another program first"?

    I think the problem (for me), is they are having an issue with a registry key that should mean absolutely nothing to the ability for something to reinstall successfully.  It makes zero sense that the presence or absence of any regkey in that location interferes with an install.  So something within the chain of events you have defined must be 'off'.


    Standardize. Simplify. Automate.
    Wednesday, February 16, 2011 1:58 PM
  • i think he just want to know which machine has the registry key, and then clean the registry before installing the software

    whatever it is, its nice to know there's a lot of what SCCM is capable of as discussed here


    ---Packie
    Wednesday, February 16, 2011 10:40 PM
  • HI I would repackage your application using a powershell deployment tool.  If you google it you can find it.  You can then have the application or in this case the script check for the key during installation and if present delete the key, then install the application.

    If not an option then I would go the DCM route.

    

    

    Friday, September 12, 2014 7:06 PM