Re: Need assistance with query



Try this.
http://smsug.ca/blogs/garth_jones/archive/2008/11/01/ou-count-of-pcs-not-reporting-within-1-day.aspx

This query will give you a count of all PC that meet a requirement for each OU.


"Dan Lewis" <waynelewis@xxxxxxxxx> wrote in message news:bb6840b9-a587-4a4f-8580-0dea2f3ffb1e@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I'm trying to build a report that will show each OU in AD and a count
of all computers in that OU and a count of computers that meet some
requirement in that OU:

SELECT OU.System_OU_Name0, count(*) as 'Count'
FROM v_R_System as SYS
JOIN v_RA_System_SystemOUName as OU on SYS.ResourceID = OU.ResourceID
JOIN AnotherView on SYS.ResourceID = AnotherView.ResourceID
WHERE AnotherView.SomeCriteria0 like "%99%"
group by OU.System_OU_Name0 order by OU.System_OU_Name0

I can't figure out how to get it to show a count of ALL systems in the
OU. Any help is appreciated.

.



Relevant Pages

  • Re: Distribute to user account objects in specific AD group in SCC
    ... For your second query, perhaps try using the subselect 'not in' ... This gave me a list of all the computers in the AD group. ... It does NOT work the same way as users in a usergroup. ... problem upon removing the computer account from the AD group and invoking ...
    (microsoft.public.sms.admin)
  • Re: Access to a custom table
    ... Create a collection based on this query for machines you want to include: ... "Tony" wrote: ... Let say I have computers named "A, B, C, D" in the database. ... > that has the NOT subselect query. ...
    (microsoft.public.sms.admin)
  • RE: How to combine existing collections to include or exclude...
    ... "Matthew Hudson" wrote: ... Servers you want minus the ones you don't want ... Add computers you don't want to show up in Collection B ... will see if I can't just send you the collection queries and the query ...
    (microsoft.public.sms.admin)
  • Re: How to combine existing collections to include or exclude...
    ... "Matthew Hudson" wrote: ... Servers you want minus the ones you don't want ... [edit query statement/Criteria] ... Add computers you don't want to show up in Collection B ...
    (microsoft.public.sms.admin)
  • RE: How to combine existing collections to include or exclude...
    ... is selecting the computers in my remote offices via AD but limits it only to ... select the query and say "computer name" not it limited ... This will grab all the computers that are in the limited collected minus the ...
    (microsoft.public.sms.admin)

Loading