Files
Compose-Files/Backups/Miker/.trash/Page-Information Server agent version Server_Info.cfc.md
T
2026-07-20 09:23:17 -04:00

55 lines
3.3 KiB
Markdown

\<cffunction name="LookupAgent" access="remote" output="false"\>
\<cfargument name="getInfo" required="false" default="" /\>
\<cfset var returnArray =[]\> \<cfquery name="MyAgentsDeployments" datasource="SCCM-CAS"\>
select * from dbo.v_Collection
where name like '%Deployment Current' and MemberCount \> 1
order by Name
\</cfquery\>
\<cfoutput query="MyAgentsDeployments" \>
\<cfquery name="AgentResults" datasource="SCCM-CAS"\>
SELECT TOP (1) APP.CI_ID AS [App CI ID], APP.CI_UniqueID AS [App Unique ID], APP.DisplayName AS [AppName], DT.CI_UniqueID AS [DT Unique ID], DT.ContentId AS [DT Content ID], CIA.Assignment_UniqueID AS [Assignment ID],
CIA.CollectionID, CIA.CollectionName, CASE CIA.OfferTypeID WHEN 0 THEN 'Required' WHEN 2 THEN 'Available' WHEN 3 THEN 'Simulate' ELSE 'Unknown' END AS [Deployment Purpose],
CASE C.CollectionType WHEN 1 THEN 'User Collection' WHEN 2 THEN 'Device Collection' ELSE 'Unknown' END AS [Collection Type], DT.Technology, DT.DisplayName AS [DT Name], APP.SoftwareVersion,
APP.Manufacturer
FROM dbo.fn_ListApplicationCIs(1033) AS APP INNER JOIN
dbo.fn_ListDeploymentTypeCIs(1033) AS DT ON DT.AppModelName = APP.ModelName AND DT.IsLatest = 1 LEFT OUTER JOIN
dbo.v_CIAssignmentToCI AS CIACI ON CIACI.CI_ID = APP.CI_ID LEFT OUTER JOIN
dbo.v_CIAssignment AS CIA ON CIACI.AssignmentID = CIA.AssignmentID LEFT OUTER JOIN
dbo.v_Collection AS C ON C.CollectionID = CIA.CollectionID
WHERE (APP.IsLatest = 1) AND (CIA.CollectionName = '#MyAgentsDeployments.Name#')
\</cfquery\>
\<cfloop query="AgentResults"\>
==\<!----==
==D:\data\ADEX\WSG-Forms\ServerServer_Info.cfc==
==Tanium uses a nonstandard naming convention in display name in "Apps & Features".==
==They are including the version in the display name. in order for the next version==
==to show up on the servers information page in ADEX, a manual entry needs to be created.==
==Create a new CFIF statement with the new information, then change the previous versions==
==CFIF statement to CFELSEIF.==
==----\>== ==\<cfif #AgentResults.AppName# eq "Tanium Client 7.4.7.1094"\>==
==\<cfset CleanAppName = "Tanium Client 7.4.7.1094"\>==
==\<cfelseif #AgentResults.AppName# eq "Tanium Client 7.4.8.1042"\>==
==\<cfset CleanAppName = "Tanium Client 7.4.8.1042"\>==
==\<cfelse\>==
==\<cfset CleanAppName = replace("#AgentResults.AppName#", "#AgentResults.SoftwareVersion#", "", "ALL") \>==
==\</cfif\>==
\<cfquery name="AgentsInstalled" datasource="SCCM-CAS"\>
SELECT TOP (100) PERCENT dbo.v_ActiveClients.Name, dbo.v_Add_Remove_Programs.Version0 as Version, dbo.v_Add_Remove_Programs.DisplayName0 as DisplayName
FROM dbo.v_Add_Remove_Programs INNER JOIN
dbo.v_ActiveClients ON dbo.v_Add_Remove_Programs.ResourceID = dbo.v_ActiveClients.MachineResourceID
WHERE (dbo.v_ActiveClients.Name = N'#arguments.getInfo#') AND (dbo.v_Add_Remove_Programs.DisplayName0 = '#CleanAppName#')
ORDER BY dbo.v_Add_Remove_Programs.DisplayName0
\</cfquery\>
\<cfloop query="AgentsInstalled"\>
\<cfset AgentsInstalledStruct = {} \>
\<cfset AgentsInstalledStruct['DisplayName'] = DisplayName /\>
\<cfset AgentsInstalledStruct['Version'] = Version /\>
\<cfscript\> arrayAppend(returnArray,AgentsInstalledStruct); \</cfscript\>
\</cfloop\> \</cfloop\>
\</cfoutput\>
\<cfreturn returnArray /\>
\</cffunction\>