当前位置:网站首页>Generate the last login user account report of the computer through SCCM SQL

Generate the last login user account report of the computer through SCCM SQL

2022-06-24 19:00:00 51CTO

Preface

SCCM Administrators often need to provide some users 、 Computer 、 Software and other related reports to colleagues for reference . I have introduced a report about computer hardware

 SCCM Database get computer hardware report

Today's introduction passed SCCM SQL Generate last logged in user 、 Relevant reports from major users .


Prerequisite

if necessary SCCM Medium Main user information (Primary User)‎‎, We must start from ConfigMgr Console enabled ‎‎ Users find ‎‎.
if necessary SCCM Chinese computer system Last logged in user information (Last Login), We must start from ConfigMgr Console enabled System discovery .

among :

Main user information (Primary User) Is based on SCCM In client configuration User and device related information Configuration options associate computers with users .


SQL Query statement

By connecting SCCM SQL database , function SQL Query statement , It can quickly generate the main users 、 Report of last logged in user . The query statement is as follows :

Select VRS.Netbios_Name0 as 'Machine Name', VUMR.UniqueUserName as 'Primary User', VRS.User_Name0 as 'Last Logon User',
VRU.Mail0 as 'Primary User Email', VRU1.mail0 as 'Last Logon User Email'
from V_R_System VRS
left join v_UserMachineRelationship VUMR on VRS.ResourceID=VUMR.MachineResourceID
left join V_R_User VRU on VRU.Unique_User_Name0=VUMR.UniqueUserName
join v_R_User VRU1 on VRU1.User_Name0=VRS.User_Name0

     
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.


Enjoy ~~

原网站

版权声明
本文为[51CTO]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/175/202206241833131600.html