myITforum and Windows IT Pro Forums

 How do I access client powershell output in SCCM server 2012

Author Message
msingri

  • Total Posts : 13
  • Scores: 0
  • Reward points : 2050
  • Joined: 4/24/2017
  • Status: offline
How do I access client powershell output in SCCM server 2012 Thursday, June 29, 2017 1:10 AM (permalink)
0
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
<message edited by msingri on Thursday, June 29, 2017 1:12 AM>
 
#1
    gjones

    • Total Posts : 2789
    • Scores: 146
    • Reward points : 226160
    • Joined: 6/5/2001
    • Location: Ottawa, Ontario, Canada
    • Status: offline
    Re:How do I access client powershell output in SCCM server 2012 Thursday, June 29, 2017 8:44 AM (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

      • Total Posts : 13
      • Scores: 0
      • Reward points : 2050
      • Joined: 4/24/2017
      • Status: offline
      Re:How do I access client powershell output in SCCM server 2012 Thursday, June 29, 2017 12:03 PM (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
      <message edited by msingri on Thursday, June 29, 2017 12:13 PM>
       
      #3
        gjones

        • Total Posts : 2789
        • Scores: 146
        • Reward points : 226160
        • Joined: 6/5/2001
        • Location: Ottawa, Ontario, Canada
        • Status: offline
        Re:How do I access client powershell output in SCCM server 2012 Thursday, June 29, 2017 12:16 PM (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

          • Total Posts : 13
          • Scores: 0
          • Reward points : 2050
          • Joined: 4/24/2017
          • Status: offline
          Re:How do I access client powershell output in SCCM server 2012 Thursday, June 29, 2017 1:07 PM (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

            • Total Posts : 2789
            • Scores: 146
            • Reward points : 226160
            • Joined: 6/5/2001
            • Location: Ottawa, Ontario, Canada
            • Status: offline
            Re:How do I access client powershell output in SCCM server 2012 Thursday, June 29, 2017 1:16 PM (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

              • Total Posts : 13
              • Scores: 0
              • Reward points : 2050
              • Joined: 4/24/2017
              • Status: offline
              Re:How do I access client powershell output in SCCM server 2012 Thursday, June 29, 2017 1:22 PM (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

                • Total Posts : 2789
                • Scores: 146
                • Reward points : 226160
                • Joined: 6/5/2001
                • Location: Ottawa, Ontario, Canada
                • Status: offline
                Re:How do I access client powershell output in SCCM server 2012 Friday, June 30, 2017 8:09 AM (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

                  • Total Posts : 13
                  • Scores: 0
                  • Reward points : 2050
                  • Joined: 4/24/2017
                  • Status: offline
                  Re:How do I access client powershell output in SCCM server 2012 Monday, July 10, 2017 8:39 PM (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

                    • Total Posts : 2789
                    • Scores: 146
                    • Reward points : 226160
                    • Joined: 6/5/2001
                    • Location: Ottawa, Ontario, Canada
                    • Status: offline
                    Re:How do I access client powershell output in SCCM server 2012 Tuesday, July 11, 2017 10:34 AM (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

                      • Total Posts : 13
                      • Scores: 0
                      • Reward points : 2050
                      • Joined: 4/24/2017
                      • Status: offline
                      Re:How do I access client powershell output in SCCM server 2012 Tuesday, July 11, 2017 11:26 AM (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

                        • Total Posts : 2789
                        • Scores: 146
                        • Reward points : 226160
                        • Joined: 6/5/2001
                        • Location: Ottawa, Ontario, Canada
                        • Status: offline
                        Re:How do I access client powershell output in SCCM server 2012 Tuesday, July 11, 2017 11:29 AM (permalink)
                        0
                        I mean exactly that, it is NOT support to query the SQL tables directly. You MUST query the SQL views.
                         
                        #12
                          msingri

                          • Total Posts : 13
                          • Scores: 0
                          • Reward points : 2050
                          • Joined: 4/24/2017
                          • Status: offline
                          Re:How do I access client powershell output in SCCM server 2012 Tuesday, July 11, 2017 11:33 AM (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

                            • Total Posts : 13
                            • Scores: 0
                            • Reward points : 2050
                            • Joined: 4/24/2017
                            • Status: offline
                            Re:How do I access client powershell output in SCCM server 2012 Wednesday, July 12, 2017 12:57 PM (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

                              • Total Posts : 2789
                              • Scores: 146
                              • Reward points : 226160
                              • Joined: 6/5/2001
                              • Location: Ottawa, Ontario, Canada
                              • Status: offline
                              Re:How do I access client powershell output in SCCM server 2012 Wednesday, July 12, 2017 1:00 PM (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
                                Online Bookmarks Sharing: Share/Bookmark

                                Jump to:

                                Current active users

                                There are 0 members and 1 guests.

                                Icon Legend and Permission

                                • New Messages
                                • No New Messages
                                • Hot Topic w/ New Messages
                                • Hot Topic w/o New Messages
                                • Locked w/ New Messages
                                • Locked w/o New Messages
                                • Read Message
                                • Post New Thread
                                • Reply to message
                                • Post New Poll
                                • Submit Vote
                                • Post reward post
                                • Delete my own posts
                                • Delete my own threads
                                • Rate post

                                2000-2017 ASPPlayground.NET Forum Version 3.9