Patch Management Group

 View Only
  • 1.  Inventory Reporting - User Information Report

    Posted Aug 20, 2013 12:41 PM

    I am trying to create a report that shows the machine and user/department/company information. Machine with user info is easy enough but what about department and company information?  We do have the information in AD,  I created an import rule from ad to import user info.



  • 2.  RE: Inventory Reporting - User Information Report

    Posted Aug 20, 2013 12:54 PM

    If you have Asset Management installed, you can run the Assets by Owner's department report - which gives you the machine, user, and department information.  It's under Reports\Service and Asset Management\Assets.



  • 3.  RE: Inventory Reporting - User Information Report

    Posted Aug 20, 2013 01:26 PM

    we dont have asset management, would make life much easier.



  • 4.  RE: Inventory Reporting - User Information Report
    Best Answer

    Posted Aug 21, 2013 12:33 AM

    Sure, run this, let me know how it works...as long as your AD import is working this should return what you need. If your missing anything you want, let me know and ill be happy to add it for you. I also used a LEFT join for the user data table. This will return rows even if their is missing user info (like department, email, phone etc) if you want to turn that off and only return machines that have full user info just take out that LEFT and leave it as JOIN...

    ------

     

    SELECT

           vc.[Name] AS Computer_Name,

           vc.[OS Name] as Operating_System,

           pu.[User] AS Primary_User,

           vu.[office telephone] AS Telephone,

           VU.[Department],

           vu.[Email],

           s.[Manufacturer] [System Manufacturer],

           s.[Model] [Computer Model],

           s.[Identifying Number] [Serial Number]

       

    FROM

           vComputer vc

           JOIN Inv_AeX_AC_Primary_User pu ON pu._ResourceGuid = vc.Guid

           LEFT JOIN vUser vu ON vu.[Name] = pu.[User]

           JOIN dbo.vHWComputerSystem s

        ON s.[_ResourceGuid]=vc.Guid

       

    WHERE

           vc.[Name] like '%'



  • 5.  RE: Inventory Reporting - User Information Report
    Best Answer

    Posted Aug 21, 2013 05:48 PM

    Michael,

    Thanks for the query, only one thing.  Some fields are missing in the department, company fields.  When I look at the table Inv_Global_User_General_Details the department and company fields field out.  I tried joining that table, but I am not having any success.  By the way I configured the 'default column mappings' Company and Department.  Things look good in the table Inv_Global_User_General_Details, but the vUser table is missing some data in Company and Department fields.  Could you help me joining v_Global_User_General_Details to the report?

     

    Thanks!



  • 6.  RE: Inventory Reporting - User Information Report

    Posted Aug 21, 2013 06:19 PM

    I figured out what i was doing wrong, I was trying to joing Primary user's guid to global users guid instead of joining vuser table display name and v_Global_User_General_Details display name.  Thanks a whole bunch Michael!



  • 7.  RE: Inventory Reporting - User Information Report

    Posted Aug 21, 2013 07:02 PM

    I do this query a little bit differently as I have noticed issues at time with primary user in my company

     

     

    select * 
     
    FROM dbo.Inv_AeX_AC_Identification ac
    left join (SELECT     _ResourceGuid, MAX([user]) AS [primary user]  
    FROM         dbo.Inv_AeX_AC_Primary_User   
    WHERE     ([User] IS NOT NULL) AND ([User] <> '') 
    GROUP BY _ResourceGuid  ) Prime                          
    on ac._resourceguid =  Prime._ResourceGuid
    LEFT OUTER JOIN  dbo.Inv_Global_Windows_Users  T20                                                                                        
    ON Prime.[primary user] = t20.[USERID] 
    LEFT OUTER JOIN dbo.Inv_Global_User_General_Details  T10                                                                                        
    ON t20._ResourceGuid = T10._ResourceGuid 


  • 8.  RE: Inventory Reporting - User Information Report

    Posted Aug 22, 2013 11:38 AM

    No problem, I'm glad it worked for you!



  • 9.  RE: Inventory Reporting - User Information Report

    Posted Aug 22, 2013 02:26 PM
    I will try out your query too. Thanks guys!