I wonder if someone a little smarter is able to offer some help finishing off a report. I've created the code below, which brings back a list of all OUs in the Lansweeper Database as clickable links along with a count of assets. I'm hoping someone can tweak this code so that:
- The domain name is automatically generated rather than being hard coded.
- The count only includes active assets.
Many thanks in advance.
Select Top 1000000
'http://lansweeper/report.aspx?det=web50FindbyDomainandOU&title=' +
tblADComputers.OU + '&@ou=' + tblADComputers.OU + '&@domain=domain'
As hyperlink_OU,
tblADComputers.OU As hyperlink_name_OU,
Count(tblAssets.Domain) As [Count of Assets]
From tblAssets
Inner Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Group By tblADComputers.OU