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 Select individual assets from reports?
by  pryan67   Go to last post Go to first unread
Last post: Today at 10:39:16 PM(UTC)
Lansweeper Exchange Mailbox Usage
by  nhouse24  
Go to last post Go to first unread
Last post: Today at 10:31:09 PM(UTC)
Lansweeper Personalize interface user ticket
by  Brighton   Go to last post Go to first unread
Last post: Today at 9:31:34 PM(UTC)
Lansweeper Update dashboard defaulting to Helpdesk
by  nriddick  
Go to last post Go to first unread
Last post: Today at 9:22:18 PM(UTC)
Lansweeper Change Management : Creating new Events type
by  Hugo Lynch   Go to last post Go to first unread
Last post: Today at 8:05:34 PM(UTC)
Lansweeper Linked Tickets - Helpdesk Workflow/Subordinate Tickets
by  Argon0  
Go to last post Go to first unread
Last post: Today at 5:22:27 PM(UTC)
Lansweeper SCCM Scanning Failure
by  wanduster   Go to last post Go to first unread
Last post: Today at 4:18:47 PM(UTC)
Lansweeper Notification ticket in pending after 1 week
by  Vasile Ciuban  
Go to last post Go to first unread
Last post: Today at 3:18:04 PM(UTC)