Your company's ad could live here and reach over 50,000 people a month!

Share This Post

Link v_MeteredUser.FullName to a full name from AD v2

To see full post see https://myitforum.com/forums/tm.aspx?high=&m=234899&mpage=1#234905

select 
  R.Netbios_Name0 as 'Computernavn', 
--  U.displayName0 as 'Bruger', 
  Full_User_Name0,
  max(ou.User_OU_Name0),
  MU.FullName as 'Brugernavn', 
  MUS.LastUsage as 'Sidst brugt', 
  MUS.UsageCount + MUS.TSUsageCount  as 'Antal brug', 
  round(MUS.UsageTime/60.0,2) as 'Forbrug (min)' 
 from 
  dbo.v_R_System R
  join dbo.v_MonthlyUsageSummary MUS on R.ResourceID = MUS.ResourceID 
  join dbo.v_MeteredFiles MF on MUS.FileID = MF.MeteredFileID 
  join dbo.v_MeteredUser MU on MUS.MeteredUserID = MU.MeteredUserID 
  join dbo.v_R_User U on U.Unique_User_Name0=MU.FullName 
  join dbo.v_RA_User_UserOUName ou on ou.ResourceID = u.ResourceID
 where 
  MF.ProductName = @RuleName 
group by 
  R.Netbios_Name0, 
--  U.displayName0, 
  Full_User_Name0,
  MU.FullName, 
  MUS.LastUsage, 
  MUS.UsageCount + MUS.TSUsageCount , 
  round(MUS.UsageTime/60.0,2)
order by 
  R.Netbios_Name0 
 


Share This Post

Leave a Reply