none
SCCM query to get Username and Machine model number

    Question

  • Hi Gurus,

    I am looking for a SCCM query that give me a list of all the  computers (laptops/Desktops) on the network

    with their respective models , serial numbers and the usernames of people logging to those computer. Basically , its something that can give me

    Computer Model            Serial Number    Username

    Thank you in advance


    Kassoka

    Thursday, February 2, 2017 12:33 PM

Answers

  • Please try to delete the v_R_System.serialnumber.

    Select v_GS_COMPUTER_SYSTEM.Model0,v_R_System.User_Name0,* 
    From v_R_System 
    Inner join v_GS_Computer_system
    On v_r_system.ResourceID =v_GS_Computer_system.ResourceID

    Select * From v_R_System 


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Tuesday, February 7, 2017 9:41 AM

All replies

  • Hi,

    Please try the following query:

    Select v_GS_COMPUTER_SYSTEM.Model0,v_R_System.serialnumber,v_R_System.User_Name0,* 
    From v_R_System 
    Inner join v_GS_Computer_system
    On v_r_system.ResourceID =v_GS_Computer_system.ResourceID



    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Friday, February 3, 2017 7:53 AM
  • Hi Xin

    Thanks for your help,

    However when i run the query in SSMS i  get a syntax error,

    sg 208, Level 16, State 1, Line 1
    Invalid object name 'v_R_System'.

    I have also tried to run it from Configuration Manager Console and i got

    invalid view error.

    Thanks in advance.


    Kassoka

    Friday, February 3, 2017 4:15 PM
  • Hi,

    Have you tried to use the SCCM database? 


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, February 6, 2017 5:23 AM
  • Hi Xi ,

    Apparently yes unfortunately the error  persists.


    Kassoka

    Monday, February 6, 2017 11:13 AM
  • Hi,

    You need to select the CM_P01.


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Tuesday, February 7, 2017 1:55 AM

  • Hi Xi,

    I do not know what could be wrong but even after selecting the CM01 DB i still get the same

    error.

    Silvestre


    Tuesday, February 7, 2017 8:56 AM
  • Please try to delete the v_R_System.serialnumber.

    Select v_GS_COMPUTER_SYSTEM.Model0,v_R_System.User_Name0,* 
    From v_R_System 
    Inner join v_GS_Computer_system
    On v_r_system.ResourceID =v_GS_Computer_system.ResourceID

    Select * From v_R_System 


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Tuesday, February 7, 2017 9:41 AM
  • Hi Xi,

    Thanks a lot , I manged to extract the information.


    Kassoka

    Tuesday, February 7, 2017 5:23 PM
  • Hi,

    Glad to hear that and thanks for your feedback.

    Have a nice day.


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Wednesday, February 8, 2017 2:42 AM