Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query for currently logged on users

Status
Not open for further replies.

raptoid

Technical User
Nov 22, 2001
121
GB
How do i creat a query to find out who is currently logged on. I need this so that i can use the remote tools.

Many thanks

 
Right-click on "Queries -> New -> Query"

Give it a name, and click on "Edit Query Statement"

Click on "Show Query Language" and paste the query below into the statement box

SELECT Name, LastLogonUserName, SMSAssignedSites, Client, IPAddresses, IPSubnets, IPXAddresses, IPXNetworkNumbers, MACAddresses, OperatingSystemNameandVersion, ResourceDomainORWorkgroup, LastLogonUserDomain, AgentName, AgentSite, AgentTime, SNMPCommunityName, SystemRoles, SMSUniqueIdentifier, ResourceId, ResourceNames, ResourceType, NetbiosName from sms_r_system where LastLogonUserName = ##PRM:sms_r_system.LastLogonUserName##


To run, right click on the query, go to execute, and enter the users name into the text box. There you go!

Two caveats: 1) it needs to be the exact logon name. Entering %partialname% doesn't work for some reason. 2) This is only as accurate as the last software (or hardware?) inventory. If you want up to the minute stats, you're better off digging through the WINS database for names, and going from there.

hope this helps!

- alex
 
thanks alex, that was just what i wanted.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top