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

Installer CutePDF and Ghostscript install (Print to PDF)
by  Ruben1  
Go to last post Go to first unread
Last post: 10/15/2019 10:35:05 AM(UTC)
Installer Team Viewer Host update / install
by  nb005   Go to last post Go to first unread
Last post: 9/20/2019 10:41:28 AM(UTC)
Installer Sophos Silent Install
by  mzipperer  
Go to last post Go to first unread
Last post: 9/5/2019 11:00:34 PM(UTC)
Installer Script - Reset Local Admin Password
by  Ricky Hignite   Go to last post Go to first unread
Last post: 7/26/2019 6:30:06 PM(UTC)
Installer LsAgent for Windows
by  bbeavis  
Go to last post Go to first unread
Last post: 7/15/2019 10:17:18 PM(UTC)
Installer Uninstall - Adobe Acrobat 9x
by  mzipperer   Go to last post Go to first unread
Last post: 7/12/2019 9:15:51 PM(UTC)
Installer Upgrade Windows 10 to 1803
by  Richard A  
Go to last post Go to first unread
Last post: 7/9/2019 2:05:20 PM(UTC)