cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
shangri-la
Engaged Sweeper
I've created a report to pull number of OS along with other information I need from the databases but when it tally up, the number is different then what's listed in Operating system licenses. Shouldn't the number be the same or pretty close. Some numbers are off 60+.
8 REPLIES 8
Hemoco
Lansweeper Alumni
Ah, I see, I thought it was the other way around.

SELECT     dbo.tblComputers.Computername, dbo.tblOperatingsystem.Version, dbo.tblOperatingsystem.SerialNumber, 
dbo.tblADComputers.OperatingSystemServicePack, dbo.tblADComputers.OperatingSystem, dbo.tblComputers.Username
FROM dbo.tblComputers LEFT OUTER JOIN
dbo.tblOperatingsystem ON dbo.tblComputers.Computername = dbo.tblOperatingsystem.Computername LEFT OUTER JOIN
dbo.tblADComputers ON dbo.tblComputers.Computername = dbo.tblADComputers.Computername
shangri-la
Engaged Sweeper
No, my query number is lower than the number listed for operating system licenses. So it's not in-active systems that is the cause.
shangri-la
Engaged Sweeper
I was able to get the number correctly by pulling from Operating system by Caption name and not from computers table by operatingsystem string. I still can't make sense of why the number is different because they are all on same domain.

Here's the code:
SELECT
dbo.tblComputers.Computername AS Computer,
dbo.tblOperatingsystem.Description,
dbo.tblComputers.Domain,
dbo.tblOperatingsystem.Caption,
dbo.tblOperatingsystem.Lastchanged,
dbo.tblComputers.Username
FROM
dbo.tblOperatingsystem
INNER JOIN dbo.tblComputers ON (dbo.tblOperatingsystem.Computername = dbo.tblComputers.Computername)
Hemoco
Lansweeper Alumni
The license count does not count the non-active computers, you query does.
Could that be the answer?
shangri-la
Engaged Sweeper
Same results I got. For example, for Windows XP I have 825 listed under Operating System licenses. When I run the report and tally the count, it's only 765 for Windows XP.

Maybe if you can explain to me how the licenses listed under the operating system configuration is pulling from, then I can have better idean why there's a 60 licenses difference.
Hemoco
Lansweeper Alumni
try this

SELECT     dbo.tblComputers.Computername, dbo.tblOperatingsystem.Version, dbo.tblOperatingsystem.SerialNumber, 
dbo.tblADComputers.OperatingSystemServicePack, dbo.tblADComputers.OperatingSystem, dbo.tblComputers.Username
FROM dbo.tblComputers INNER JOIN
dbo.tblOperatingsystem ON dbo.tblComputers.Computername = dbo.tblOperatingsystem.Computername INNER JOIN
dbo.tblADComputers ON dbo.tblComputers.Computername = dbo.tblADComputers.Computername


Could the difference by caused by the non-active computers in this report?
shangri-la
Engaged Sweeper
SELECT
tblOperatingsystem.Version,
tblOperatingsystem.SerialNumber,
tblADComputers.OperatingSystemServicePack,
tblADComputers.OperatingSystem,
tblOperatingsystem.Computername,
tblComputers.Username
FROM
tblADComputers
INNER JOIN tblOperatingsystem ON (tblADComputers.Computername = tblOperatingsystem.Computername)
INNER JOIN tblComputers ON (tblOperatingsystem.Computername = tblComputers.Computername)
Hemoco
Lansweeper Alumni
Most likely there is an error in your report, could you post it please.