Notification

Icon
Error

Windows 7 EOL - Windows 7 EOL report with UPN

Posted: Thursday, September 19, 2019 2:31:26 AM(UTC)
Mark Groveunder

Mark Groveunder

Member Original PosterPosts: 2
0
Like
I created a report using the SQL from the Lansweeper site:

https://www.lansweeper.c...ows-7-end-of-life-audit/

But, I need the UPN field included in this report. I've tried to add the table tblADusers and the UPN field, but can't get it to work. Any suggestions?
Esben.D
#1Esben.D Member Administration Posts: 1,877  
posted: 9/19/2019 12:22:43 PM(UTC)
I think your on the right track. Most likely you didn't join the AD table with the other correctly, since it isn't done automatically in the report builder.

You'll need to manually connect tbladusers to tblassets on both username and userdomain. Then you can enable the UPN and it should work.

This should be your result:
Code:
Select Top 1000000 tsysOS.Image As icon,
  tblAssets.AssetID,
  tblAssets.AssetName,
  tblAssets.Domain,
  tblAssets.Username,
  tblAssets.Userdomain,
   tblADusers.UPN,
  tblAssets.IPAddress,
  tblAssets.Description,
  tblAssetCustom.Manufacturer,
  tblAssetCustom.Model,
  tblOperatingsystem.Caption As [Operating System],
  tblAssets.SP As SP,
  Case
    When tsysOS.OSname = 'Win 7' And tblAssets.SP = 1 Then DateDiff(dd,
      GetDate(), '01/14/2020')
  End As DaysRemaining,
  tblAssetCustom.Location,
  tsysIPLocations.IPLocation,
  tblAssets.Firstseen,
  tblAssets.Lastseen,
  tblAssets.Lasttried,
  Case
    When tsysOS.OSname = 'Win XP' Then '#ffadad'
    When tsysOS.OSname = 'Win 7' And tblAssets.SP <> 1 Then '#ffdb8e'
    When tsysOS.OSname = 'Win 7' And tblAssets.SP = 1 Then '#ffbe38'
    When GetDate() > '01/14/2019' And GetDate() < '01/14/2020' And
      tsysOS.OSname = 'Win 7' And tblAssets.SP = 1 Then '#ff8b00'
    When GetDate() > '01/14/2020' And tsysOS.OSname = 'Win 7' And
      tblAssets.SP = 1 Then '#ffadad'
    Else '#d4f4be'
  End As backgroundcolor
From tblAssets
  Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
  Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
  Left Join tsysIPLocations On tsysIPLocations.LocationID = tblAssets.LocationID
  Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
  Inner Join tblOperatingsystem On
    tblAssets.AssetID = tblOperatingsystem.AssetID
  Inner Join tblADusers On tblADusers.Username = tblAssets.Username And
    tblADusers.Userdomain = tblAssets.Userdomain
Where tblComputersystem.Domainrole < 2 And tblAssetCustom.State = 1
Order By tblAssets.Domain,
  tblAssets.AssetName
Mark Groveunder
#2Mark Groveunder Member Original PosterPosts: 2  
posted: 9/19/2019 3:50:50 PM(UTC)
That worked great! Thanks for the help!
RC62N
#3RC62N Member Posts: 381  
posted: 9/19/2019 4:42:11 PM(UTC)
Just a heads-up, in case you weren't aware: if you've got a Windows 10 Enterprise Agreement or Enterprise Agreement Subscription, it looks like you get a bonus year of Windows 7 support.

Computerworld article: Microsoft offers free post-2020 Windows 7 support for Win 10 Enterprise subscribers
TechCrunch article: Microsoft will let some Windows 7 customers get free security updates for an extra year

Active Discussions

Lansweeper Notebooks report
by  Martin Izquierdo   Go to last post Go to first unread
Last post: Today at 4:08:32 PM(UTC)
Lansweeper Unauthorized Administrators by OU
by  Craig Fair  
Go to last post Go to first unread
Last post: Yesterday at 8:05:04 PM(UTC)
Lansweeper Waiting reboot status
by  RJJJR   Go to last post Go to first unread
Last post: Yesterday at 7:01:42 PM(UTC)
Lansweeper reboot required or awaiting reboot report
by  RJJJR  
Go to last post Go to first unread
Last post: Yesterday at 6:58:36 PM(UTC)
Lansweeper Report 32 or 64bit software
by  Esben.D   Go to last post Go to first unread
Last post: Yesterday at 12:21:46 PM(UTC)
Lansweeper Report Needed of just DEFAULT GROUP assets
by  SHib11  
Go to last post Go to first unread
Last post: 10/15/2019 2:57:23 PM(UTC)
Lansweeper No longer shows up-to-date with new OS version
by  ICT Support  
Go to last post Go to first unread
Last post: 10/15/2019 11:29:10 AM(UTC)