一般討論 How to get a list of applications discovered out of MAP

  • Thursday, February 02, 2012 1:46 AM
    Moderator
     
      Has Code
    Currently, we don’t have a way to generate a report of products installed by machine because of the row limitation of Excel which could easily be exceeded in a large environment. We are trying to determine if we can add this feature in a future release. In the meantime, here is a method for extracting that data into Excel and then you can use pivot tables or whatever you like to distill the information.

    Disclaimer:

    This advice assumes that you are comfortable using SQL Management Studio or SQL commands to accomplish these tasks. No guarantees or warranties are given or implied by using this advice and it is to be used at your own risk.

    Option 1:

    If you just need to know the query to return the list of applications so you can write your own custom query, run this:
    select * from Get_UI_ProductResults ()
    

    Note: If you copy/paste the query and get an error, try manually typing it. Sometimes hidden characters or alternate versions of characters get substituted by the browser and can't be read by SQL Server.

    Option 2:

    If you want to import the data into Excel: (assumes Excel 2010)
    1. Create a view in SQL Server Management Studio:
      1. Find the database with the info you want
      2. Find the 'Views' folder and right-click
      3. Select 'New View…'
      4. In the 'Add Table' dialogue box, go to the 'Functions' tab
      5. Select 'Get_UI_ProductsResults'
      6. Click Add
      7. Click Close
      8. In the function box, choose Computer Name, Name, ProductVersion, ProductVendor
      9. Go to File » Save and choose a name for the view
      Once you have created this view, you can open Excel on the machine with MAP installed and use the data connection from other sources to import that view into Excel and manipulate the data any way you want.
    2. Connect Excel 2010 to the SQL Server database:
      1. Click on the 'Data' tab
      2. In the 'Get External Data' area, choose 'From Other Sources'
      3. Choose 'From SQL Server'
      4. Enter the server name with instance, i.e. YourComputerName\MAPS
      5. From the drop down list, select the database that you created the view in
      6. Find and Select the view you created above
      7. Click Finish
      8. Choose how you want to view the data
      Note: I prefer to import the data as a table so I can see the data in a “raw” format before I create a pivot table.

    Warning:

    Before Excel 2007, the row limit was 65,536 and now it is 1,048,576 rows. It is recommended that you check to see how many rows are returned in the view’s query before importing the view into Excel, otherwise it will fail.

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

All Replies

  • Thursday, August 02, 2012 7:58 AM
     
     
    Great answer Michael!
    Thanks for the guide! I have been looking for a way to do this for a long time!

    Kinds regards
    Karl Jørgen Weme
    MCP

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. Please VOTE as HELPFUL if the post helps you. This can be beneficial to other community members reading the thread.

  • Thursday, August 02, 2012 5:12 PM
    Moderator
     
     

    Thanks, this was a hack I came up with to address a common request from people, and we're still looking for a way to present this info in a way that won't exceed the Excel limits when reporting data from large environments. That said, we did add a custom SQL View to 7.0 that is targeted at presenting this information in a more comprehensive way so you can use Pivot Tables to see the data in all kinds of interesting ways. Since MAP 7.0 introduces the use of LocalDB if you don't already have your own "MAPS" instance of SQL Server running, there are some additional considerations when trying to export the data from Excel.

    We have a full set of directions for exporting the new view into Excel in this blog post: http://blogs.technet.com/b/mapblog/archive/2012/07/09/planning-for-desktop-virtualization-with-the-map-toolkit-7-0-4-of-4.aspx


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.