Altiris Software Dev Kit (ASDK)

 View Only
  • 1.  Report - Adding a Users Full name in an Altiris to existing report

    Posted Jun 25, 2018 09:32 AM

    This might be an easy question but I'm having a little difficulty.  I need to add a Full Name and email address columns to this report.  I have tried a few different ways but can't seem to get a report that runs properly. Below is what I currently have. I know  vUser contains the "Display Name" and "Email" fields that contains the full name. How can I add this to the report and have it run properly? 

    Thanks!

    SELECT DISTINCT
    vc.Guid [Guid],
    vc.Name [Hostname],
    [user],
    
    vc.Domain,
    vc.[OS Name],
    vc.[IP Address],
    vc.[MAC Address],
    
    arp.DisplayName [Software Name],
    arp.DisplayVersion [Software Version],
    
    FROM vComputer vc
    
    JOIN Inv_AddRemoveProgram arp ON arp._ResourceGuid=vc.Guid
    
    WHERE DisplayName LIKE 'vanguard Professional%' AND arp.InstallFlag=1

     



  • 2.  RE: Report - Adding a Users Full name in an Altiris to existing report

    Posted Jun 26, 2018 08:04 AM

    You could use the "Asset User Owners" Resource Association and join on that.

    SELECT DISTINCT
    	vc.[Guid] [Guid]
    	,vc.[Name] [Hostname]
    	,[user]
    	,vc.Domain
    	,vc.[OS Name]
    	,vc.[IP Address]
    	,vc.[MAC Address]
    	--,arp.DisplayName [Software Name]
    	--,arp.DisplayVersion [Software Version]
    	,u.[Guid] AS UserGuid
    	,u.[Name] AS UserName
    	,u.Email AS UserEmail
    FROM 
        vComputer vc
        LEFT JOIN ResourceAssociation ra ON vc.[Guid] = ra.ParentResourceGuid AND (ra.ResourceAssociationTypeGuid = 'ed35a8d1-bf60-4771-9dde-092c146c485a') --Asset User Owners 
        LEFT JOIN vUser u ON ra.ChildResourceGuid = u.[Guid]
        --JOIN Inv_AddRemoveProgram arp ON arp._ResourceGuid=vc.Guid
    --WHERE 
    --	DisplayName LIKE 'vanguard Professional%' AND arp.InstallFlag=1

     



  • 3.  RE: Report - Adding a Users Full name in an Altiris to existing report
    Best Answer

    Posted Jun 26, 2018 08:46 AM

    Here is another variation. This is using the built in query for 'vAC_PrimaryUser'. I basically took the query and made a small modification to add the email address as well.

    select distinct vc.Guid [Guid],
    	vc.Name [Hostname],
    	[user],
    	vc.Domain,
    	vc.[OS Name],
    	vc.[IP Address],
    	vc.[MAC Address],
    	arp.DisplayName [Software Name],
    	arp.DisplayVersion [Software Version],
    	a.[Primary User],
    	a.ResourceGuid
    from vComputer vc
    inner join Inv_AddRemoveProgram arp
    	on arp._ResourceGuid = vc.Guid
    left join (
    	select primuser.ParentResourceGuid as ResourceGuid,
    		ISNULL(userdetails.[Display Name], ISNULL(NULLIF(LTRIM(RTRIM(ISNULL(userdetails.[Given Name], '') + ' ' + ISNULL(userdetails.Surname, ''))), ''), usr.Name)) as [Primary User],
    		userdetails.Email
    	from vAssetMaster primuser
    	left join RM_ResourceUser usr
    		on primuser.ChildResourceGuid = usr.Guid
    	left join Inv_Global_User_General_Details userdetails
    		on usr.Guid = userdetails._ResourceGuid
    	) a
    	on a.ResourceGuid = vc.Guid
    where DisplayName like 'vanguard Professional%'
    		and arp.InstallFlag = 1
    

     



  • 4.  RE: Report - Adding a Users Full name in an Altiris to existing report

    Posted Jun 26, 2018 09:05 AM

    Thank you helping out .

    I'm still no getting the Full name. This was the problem I had, for some reason I was unable to pull it in. I'm not too good at sql but I am learning.

    Here is what I am getting.  The problem is the first and last name isn't showing.  I know the vUser has the "display name" that has exactly what I require.

    Your edit does bring in the email which is great.  Is it possible to populate it with the full name?

     

    Hostname User Domain OS Name IP Address MAC Address UserGuid Username UserEmail
    1234567 abcdef .lan Windows 10 Enterprise 10.x.x.x.x 64-00-00-00-00 bcda51f9-af04-4cb2-8082-668c2446546 abcdef abcdef.fedcba@domain

     

    Below is the vUser field. 

    Name Domain Personal Title Given Name Initials Surname Display Name Office Location
    abcdef .lan IT guy I guy Guy Guy,IT 555-555-5555


  • 5.  RE: Report - Adding a Users Full name in an Altiris to existing report
    Best Answer

    Posted Jun 26, 2018 09:10 AM

    Add to the SELECT an extra Field:

    ,u.[Display Name]

     



  • 6.  RE: Report - Adding a Users Full name in an Altiris to existing report

    Posted Jun 26, 2018 10:09 AM

    Thank You Donald!  Worked wonders. I really appreciate the help. 

     

    -Scott



  • 7.  RE: Report - Adding a Users Full name in an Altiris to existing report

    Posted Jun 26, 2018 10:29 AM

    That did work as well. Thank you again Alex, for helping out. It is really appreicated!