‎08-22-2016 03:52 PM
Select Top 100000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tsysOS.OSname,
Count(tblSharesUni.Type) As TotalFolderShares
From tblAssets
Inner Join tblFeature On tblFeature.AssetId = tblAssets.AssetID
Inner Join tblFeatureUni On tblFeatureUni.featUniID = tblFeature.featUniId
Inner Join tblShares On tblShares.AssetID = tblAssets.AssetID
Inner Join tblSharesUni On tblShares.ShareUniqueID =
tblSharesUni.ShareUniqueID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tblAssetCustom On tblAssetCustom.AssetID = tblAssets.AssetID
Inner Join tblComputersystem On tblComputersystem.AssetID = tblAssets.AssetID
Where tblSharesUni.Name Not Like 'print$' And tblSharesUni.Name Not Like
'CertEnroll' And tblSharesUni.Name Not Like 'prnproc$' And
tblSharesUni.Name Not Like 'SYSVOL' And tblSharesUni.Name Not Like 'NETLOGON'
And tblSharesUni.Name Not Like 'VBRCatalog' And tblSharesUni.Type = 0 And
tblFeatureUni.featureName != 'FSRM-Infrastructure' And
tblComputersystem.Domainrole > 1 And tblAssetCustom.State = 1
Group By tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tsysOS.OSname,
tblFeatureUni.featureName,
tblFeatureUni.featureCaption
Order By tblAssets.AssetName
‎08-23-2016 12:00 PM
Select Top 100000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tsysOS.OSname As OSName,
tblAssets.Lastseen As LastSeen,
Count(tblSharesUni.Type) As TotalFileShares
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join tblShares On tblAssets.AssetID = tblShares.AssetID
Inner Join tblSharesUni On tblShares.ShareUniqueID =
tblSharesUni.ShareUniqueID
Where tblAssets.AssetID Not In (Select tblFeature.AssetId
From tblFeature Inner Join tblFeatureUni On tblFeatureUni.featUniID =
tblFeature.featUniId
Where tblFeatureUni.featureName Like 'FSRM-Infrastructure%') And
tblAssetCustom.State = 1 And tblComputersystem.Domainrole > 1 And
tblSharesUni.Type = 0 And tblSharesUni.Name Not Like 'print$' And
tblSharesUni.Name Not Like 'prnproc$' And tblSharesUni.Name Not Like 'SYSVOL'
And tblSharesUni.Name Not Like 'NETLOGON' And tblSharesUni.Name Not Like
'CertEnroll' And tblSharesUni.Name Not Like 'VBRCatalog'
Group By tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tsysOS.OSname,
tblAssets.Lastseen
Order By tblAssets.AssetName
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now