cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Boots315
Engaged Sweeper

Below is my current report, but it's not showing me the assets missing this cert and I'm not sure what I'm doing wrong here. Any suggestions? 

 

Select Top 1000000 tsysOS.Image As icon,
  tblAssets.AssetID,
  tblAssets.AssetName,
  tblAssets.Domain,
  tblAssets.Username,
  tblAssets.Userdomain,
  tblAssets.IPAddress,
  tblAssets.Firstseen,
  tblAssets.Lastseen,
  tblAssets.Lasttried,
  tsysOS.OSname
From tblAssets
  Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
  Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
  Inner Join tblCertificateLocations On
      tblAssets.AssetID = tblCertificateLocations.AssetID
  Inner Join tblCertificates On tblCertificates.CertificateID =
      tblCertificateLocations.CertificateID
Where
  tblAssets.AssetID Not In (Select Top 1000000 tblCertificateLocations.AssetID
    From tblCertificates Inner Join tblCertificateLocations On
          tblCertificates.CertificateID = tblCertificateLocations.CertificateID
    Where tblCertificates.Serial = '12345678901234567890123456')
  And tblAssets.Lastseen > GetDate() - 14 And tsysOS.OSname Like 'Win 2%' And
  tblAssetCustom.State = 1
Order By tblAssets.Domain,
  tblAssets.AssetName

 

 

1 REPLY 1
Mister_Nobody
Honored Sweeper II
Select Top 1000000 tsysOS.Image As icon,
  tblAssets.AssetID,
  tblAssets.AssetName,
  tblAssets.Domain,
  tblAssets.Username,
  tblAssets.Userdomain,
  tblAssets.IPAddress,
  tblAssets.Firstseen,
  tblAssets.Lastseen,
  tblAssets.Lasttried,
  tsysOS.OSname
From tblAssets
  Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
  Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
  Left Join tblCertificateLocations On
      tblAssets.AssetID = tblCertificateLocations.AssetID
  Left Join tblCertificates On tblCertificates.CertificateID =
      tblCertificateLocations.CertificateID
Where
  tblAssets.AssetID Not In (Select Top 1000000 tblCertificateLocations.AssetID
    From tblCertificates Inner Join tblCertificateLocations On
          tblCertificates.CertificateID = tblCertificateLocations.CertificateID
    Where tblCertificates.Serial = '1234567890') And
  tblAssets.Lastseen > GetDate() - 14 And tsysOS.oscode Like '%S' And
  tblAssetCustom.State = 1
Order By tblAssets.Domain,
  tblAssets.AssetName