SCCM SQL script to find users associated with computers

SELECT  GS.Name0,
GS.UserName0,
WS.LastHWScan,
GS.Domain0,
OS.Caption0,
SYS.SystemRole0
FROM
v_GS_COMPUTER_SYSTEM GS,
v_GS_OPERATING_SYSTEM OS,
v_GS_SYSTEM SYS,
v_GS_WORKSTATION_STATUS WS
WHERE
GS.ResourceID = SYS.ResourceID
AND WS.ResourceID = GS.ResourceID
AND OS.ResourceID = GS.ResourceID
AND SYS.SystemRole0<>’Server’
AND Datediff(dd,WS.LastHWScan,getdate()) > -1 and
GS.username0 in (‘DOMAIN\user1′,’DOMAIN\user2′,’DOMAIN\user3’)

http://eskonr.com/2012/08/sccm-configmgr-report-find-computers-for-the-list-of-selected-users/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s