Hot!How do I access client powershell output in SCCM server 2012

Author
msingri
Starting Member
  • Total Posts : 16
  • Scores: 0
  • Reward points: 3200
  • Joined: 2017/04/24 15:10:07
  • Status: offline
2017/06/29 00:10:32 (permalink)
0

How do I access client powershell output in SCCM server 2012

Hi Everyone,
 
I am new to SCCM and am tasked to execute a powershell script on a client machine. I managed to do that by deploying a package. Now I am lost on how to access the powershell output on the SCCM server once its done running on the client machine.
 
Is this even possible? To be able to run a script on client and read the output in SCCM server? If yes, how should I go about doing this?
 
Any help is much appreciated. 
 
Thanks,
Medha
post edited by msingri - 2017/06/29 00:12:40
#1

14 Replies Related Threads

    gjones
    Expert Member
    • Total Posts : 2816
    • Scores: 146
    • Reward points: 248130
    • Joined: 2001/06/05 12:32:00
    • Location: Ottawa, Ontario, Canada
    • Status: offline
    Re:How do I access client powershell output in SCCM server 2012 2017/06/29 07:44:44 (permalink)
    0
    What do you mean by output?
    No you can't run a scrip to CM12 and see the results within the CM console?
    #2
    msingri
    Starting Member
    • Total Posts : 16
    • Scores: 0
    • Reward points: 3200
    • Joined: 2017/04/24 15:10:07
    • Status: offline
    Re:How do I access client powershell output in SCCM server 2012 2017/06/29 11:03:54 (permalink)
    0
    Hi gjones,
     
    What I am trying to do is fetch the edition of a installed software from registry keys since its not discovered by SCCM out of the box. So I built a script to find this information and update the database with this information. For my test scenario, I created a new table where this information will be populated. I am not able to connect to the SCCM DB from the client machine and hence need the information communicated back to SCCM Server from where I can populate table.
     
    If there is a better way of achieving this, I would love to know how to.
     
    Thanks,
    Medha
    post edited by msingri - 2017/06/29 11:13:22
    #3
    gjones
    Expert Member
    • Total Posts : 2816
    • Scores: 146
    • Reward points: 248130
    • Joined: 2001/06/05 12:32:00
    • Location: Ottawa, Ontario, Canada
    • Status: offline
    Re:How do I access client powershell output in SCCM server 2012 2017/06/29 11:16:42 (permalink)
    0
    What do you mean it is not discovered by CM out of the box? Exactly what Reg key?
    Have you looked at regkeytomof? https://www.enhansoft.com/blog/how-to-use-regkeytomof
    #4
    msingri
    Starting Member
    • Total Posts : 16
    • Scores: 0
    • Reward points: 3200
    • Joined: 2017/04/24 15:10:07
    • Status: offline
    Re:How do I access client powershell output in SCCM server 2012 2017/06/29 12:07:39 (permalink)
    0
    Hi gjones,
     
    What I meant was, when the hardware inventory runs, the information populated in the database doesn't have edition (standard, professional, enterprise, so on) information. Lets say for Adobe Acrobat, the edition is part of the guid (7770) of the product and that needs to be parsed to get a human readable edition (Pro). This is not populated for Acrobat when its inventoried out of the box.
     
    The link you pointed me to is informative. From what I understand, I could collect additional information from registry keys by updating configuration.mof. That would work if edition is always found in the same location. But thats not true, different softwares have edition at different places. Another example would be for db2 its at HKEY_LOCAL_MACHINE\SOFTWARE\IBM\DB2\*\CurrentVersion\ - Description text contains edition information
     
    So my question is, to be able to find editions for all softwares, would I need to be adding custom configuration.mof entry for each of the software?
     
    Thanks,
    Medha
    #5
    gjones
    Expert Member
    • Total Posts : 2816
    • Scores: 146
    • Reward points: 248130
    • Joined: 2001/06/05 12:32:00
    • Location: Ottawa, Ontario, Canada
    • Status: offline
    Re:How do I access client powershell output in SCCM server 2012 2017/06/29 12:16:26 (permalink)
    0
    But the GUID is already collected by HW inv. sooo there is not need for RegKeyToMof.
     
    For DB2, yes you will need to create custom mof for it, in order to collect this info.
     
    Each software title handles thing differently, for example Visio, good luck getting the version details. In a nutshell there is not a one size fit all.
     
    Although I'm not a huge fan of AI data, have you look at it?
    #6
    msingri
    Starting Member
    • Total Posts : 16
    • Scores: 0
    • Reward points: 3200
    • Joined: 2017/04/24 15:10:07
    • Status: offline
    Re:How do I access client powershell output in SCCM server 2012 2017/06/29 12:22:59 (permalink)
    0
    Correct, guid is already available so good on that. Thats what I thought about the rest of the software editions.
     
    I am not aware of the AI data, can you please point me to relevant documentation?
     
    Appreciate all the help gjones!
     
    Thanks,
    Medha 
    #7
    gjones
    Expert Member
    • Total Posts : 2816
    • Scores: 146
    • Reward points: 248130
    • Joined: 2001/06/05 12:32:00
    • Location: Ottawa, Ontario, Canada
    • Status: offline
    Re:How do I access client powershell output in SCCM server 2012 2017/06/30 07:09:34 (permalink)
    0
    The AI classes can be found unto Asset and Compliance | Asset Inteligence, from there you can make sure that all Classes are enabled Except from sms_shortwareshortcut
    #8
    msingri
    Starting Member
    • Total Posts : 16
    • Scores: 0
    • Reward points: 3200
    • Joined: 2017/04/24 15:10:07
    • Status: offline
    Re:How do I access client powershell output in SCCM server 2012 2017/07/10 19:39:12 (permalink)
    0
    Hi gjones,
     
    I already have all of the classes enabled including SMS_SoftwareShortcut. Dont see any related edition information. 
     
    What do you think of updating the configuration.mof to add custom class to fetch editions. The piece I am missing is when the content is collected (lets say), how or where does it get saved in database? Does it create a new table? Or is there a way to associate which table to populate? 
     
    Thanks,
    Medha
    #9
    gjones
    Expert Member
    • Total Posts : 2816
    • Scores: 146
    • Reward points: 248130
    • Joined: 2001/06/05 12:32:00
    • Location: Ottawa, Ontario, Canada
    • Status: offline
    Re:How do I access client powershell output in SCCM server 2012 2017/07/11 09:34:49 (permalink)
    0
    Great have you review the AI data to see if it get you the details that you want?
     
    Sure you can create custom HW inv classes. Once a new HWinv class is imported all of the SQL views are created for it. It is not supported to query SQL tables.
     
    #10
    msingri
    Starting Member
    • Total Posts : 16
    • Scores: 0
    • Reward points: 3200
    • Joined: 2017/04/24 15:10:07
    • Status: offline
    Re:How do I access client powershell output in SCCM server 2012 2017/07/11 10:26:50 (permalink)
    0
    Yes, I looked into AI data and it doesn't gather the details I am looking for.
     
    Ok, so views are automatically created for new HWinv classes. But what do you mean by "It is not supported to query SQL tables"?
     
    Thanks,
    Medha
    #11
    gjones
    Expert Member
    • Total Posts : 2816
    • Scores: 146
    • Reward points: 248130
    • Joined: 2001/06/05 12:32:00
    • Location: Ottawa, Ontario, Canada
    • Status: offline
    Re:How do I access client powershell output in SCCM server 2012 2017/07/11 10:29:58 (permalink)
    0
    I mean exactly that, it is NOT support to query the SQL tables directly. You MUST query the SQL views.
    #12
    msingri
    Starting Member
    • Total Posts : 16
    • Scores: 0
    • Reward points: 3200
    • Joined: 2017/04/24 15:10:07
    • Status: offline
    Re:How do I access client powershell output in SCCM server 2012 2017/07/11 10:33:53 (permalink)
    0
    Fair enough, that works perfectly fine as well. Let me give the HWinv another shot (failed the first time).
     
    Thanks,
    Medha
    #13
    msingri
    Starting Member
    • Total Posts : 16
    • Scores: 0
    • Reward points: 3200
    • Joined: 2017/04/24 15:10:07
    • Status: offline
    Re:How do I access client powershell output in SCCM server 2012 2017/07/12 11:57:13 (permalink)
    0
    Ok, I got the HWinv to work, it created a view as expected. Now the question is, if I have to do this for a bunch of softwares, it essentially means as many new views, thats cumbersome. Is there a way to create a single new class for all the different software editions and populate them all in a single view (with multiple entries)?
     
    I am unable to find any examples on how to do this, any pointers is much appreciated.
     
    Thanks,
    Medha
    #14
    gjones
    Expert Member
    • Total Posts : 2816
    • Scores: 146
    • Reward points: 248130
    • Joined: 2001/06/05 12:32:00
    • Location: Ottawa, Ontario, Canada
    • Status: offline
    Re:How do I access client powershell output in SCCM server 2012 2017/07/12 12:00:56 (permalink)
    0
    So to answer you question, sure you can do it within one view BUT you will need to create a script to collect, parse and populate an WMI class for you. This will be as much work if not more work than creating one WMI class per SW product.
     
    Either way you have lots of work ahead of you.
    #15
    Jump to:
    © 2018 APG vNext Commercial Version 5.5