WQL Queries - Show login IDs to Computers
Main Menu
>
Tools
>
WQL Queries
Show login IDs to Computers
Query to show user login IDs linked to computers.
Code
Query Type:
------------------------------------------------ select SMS_R_User.Name,SMS_R_System.LastLogonUserName,SMS_R_System.Name, SMS_G_System_WORKSTATION_STATUS.LastHardwareScan,SMS_G_System_COMPUTER_SYSTEM.UserName,SMS_R_User.title , sms_r_user.department from SMS_R_System inner join SMS_R_User on SMS_R_User.Username= SMS_R_System.LastLogonUserName inner join SMS_G_System_COMPUTER_SYSTEM on SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceId inner join SMS_G_System_WORKSTATION_STATUS on SMS_G_System_WORKSTATION_STATUS.ResourceID = SMS_R_System.ResourceId -------------------------------- Query Type:System Resource --------------------------------- select SMS_R_System.LastLogonUserName, SMS_R_System.Name, SMS_R_System.ResourceId, SMS_R_System.ResourceType from SMS_R_System order by SMS_R_System.LastLogonUserName ----------------------------------------
Documentation
These queries are written to be used in the Query node. They cannot be used to create a collection in their current form. The first query is used to show the LastLogonUser and UserName. These are pulled by the client via Inventory and discovery data. Create a new query and select unspecified for the query type and cut and paste this query. You cannot right click on a computer and perform an action because you have a SMS_G_System view in the query. The AD discovery was extended to pull extra information (department, etc) so this query may fail. The second query is written so you can right click on the computer and perform an action. Note that only SMS_R_System data is shown. Created by Matthew Hudson --------------------------------