Jump to content


ingram59

Query logins by computer or user.

Recommended Posts

I've been tasked with creating a couple of queries and I'm not a SQL coder. If this can be done through the SCCM console, that would be great. I'm not sure how to build these.

 

Query 1: List all computers where a specific user id has been logged on .

Query 2: List all users who have logged in to a specific computer.

 

Thanks is advance for the assistance.

Share this post


Link to post
Share on other sites

You can build the query through the console:

 

For Query 1

 

Queries - New - Query

Provide a name for the query

Object Type - System Resource

Edit Query Statement...

Select Criteria tab

Select the New criteria button (golden sparkle)

Select...

Attribute class dropdown = System Resource

Attribute dropdown = Last Logon User Name

Value = username <enter>

Ok, Finish, Apply....

 

Alternatively you should be able to use the following WQL: select * from SMS_R_System where SMS_R_System.LastLogonUserName = "username" Replace username with the name of the specific userid (case sensitive).

 

I don't know if you can get Query 2, I'm unsure if SCCM inventories all logons. Might be easier to write a vbs script to capture that information.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.