Query on Prohibited application for specific OU

Select distinct 
	ou.system_ou_name0,
	sys.Netbios_Name0, 
	fcm.SiteCode,sys.User_Domain0, 
	sys.User_Name0,
--	DATEADD(mi,(usr.lastLogontimeStamp0  / 600000000) - 157258080,0) AS [Last Logon Time Stamp (UTC)],
	usr.company0, 
	sys.Operating_System_Name_and0, 
	Displayname0,
	Version0,
	InstallDate0
FROM 
	dbo.v_R_System sys 
	JOIN dbo.v_r_User usr on SYS.user_name0 = usr.user_name0 
	join dbo.v_Add_Remove_Programs arp ON sys.ResourceID = arp.ResourceID 
	JOIN dbo.v_FullCollectionMembership fcm on sys.ResourceID = fcm.ResourceID 
	left outer join dbo.v_RA_System_SystemOUName OU on sys.ResourceID = OU.ResourceID 
WHERE 
	fcm.CollectionID=@CollID	
	and ou.system_ou_name0 = 'enhansoft.com/WORKSTATIONS' 
	and (lower(DisplayName0) like '%ĀµTorrent%' 
	or lower(DisplayName0) like '%skype%' 
	or lower(DisplayName0) like '%Remote PC%'
	or lower(DisplayName0) like '%AOL%'
	or lower(DisplayName0) like '%Ares%'
	or lower(DisplayName0) like '%Galaxy%') 

Leave a Reply

Your email address will not be published. Required fields are marked *