in

myITforum.com

This Blog

Syndication

News

What Video Game Character Are You? I am Kung Fu Master.
I am Kung Fu Master.

I like to be in control of myself. I dislike crowds, especially crowds containing people trying to kill me. Even though I always win, I prefer to avoid fights if possible.

What Video Game Character Are You?

Blogs I read

Rob Marshall @ MyItForum.com


... my god, it's full of stars

Simple SQL query - Show collections a client is a member of

Was just asked to create a ConfigMgr query to show which collections a client is a member of:

Note: Collections do not replicate upwards, so running this on your Central for a Tier 2\3 client will not show anything. Either run it on the assigned site server, or from a higher up site server where all the collections are managed ...

SELECT     v_FullCollectionMembership.CollectionID, v_FullCollectionMembership.Name as [Client], v_Collection.Name AS [Collection Name],
                      v_FullCollectionMembership.SiteCode
FROM         v_FullCollectionMembership INNER JOIN
                      v_Collection ON v_FullCollectionMembership.CollectionID = v_Collection.CollectionID
WHERE V_FullCollectionMembership.Name = '<MACHINE NAME>'

This can even go in to a report, create the report, create a prompt called @ClientName, edit the above '<MACHINE NAME>' text (don't forget to strip the apostrophes out too) and replace with @ClientName, then replace the existing default query in the new report with the modified SQL statement from above.

You could even link this report to the built-in "All resources in a specific collection" report, a good idea as that report then links to another report showing you the advertisements for that client which can then be drilled in to even further to give you the "Status of a specific advertisement". Very handy if you first want to know what collections the client is a member of (for deployment troubleshooting), then go through to the advertisement information.

This will probably work on SMS2003 as well, I don't think those views changed ...

(PS ... I hate the way community server messes with formatting, gets font sizes wrong, won't let you reformat easily, and generally makes a mare of things I post ... yes I even blame CS for my typo's, factually incorrect postings and everything else, grrr, double grrr)

 

 

Read the complete post at http://wmug.co.uk/blogs/r0b/archive/2009/05/15/simple-sql-query-show-collections-a-client-is-a-member-of.aspx

Copyright - www.myITforum.com, Inc. - 2010 All Rights reserved.
Powered by Community Server (Commercial Edition), by Telligent Systems