Feature Request - GetCollectionMembership

May 6, 2010 at 6:14 PM

I'm kinda suprised this doesn't already exist (am i missing something?). I believe it's pretty easy to give a collection id and get back a list of servers that are in that collection.

Coordinator
May 22, 2010 at 5:15 PM

The webservice is mainly targeted to Deployment related operations. Would you mind explaining the usage of such function?

Regards

Maik

May 25, 2010 at 5:19 AM

I was actually just planning on using it for verification. I was writing some scripts for people who were not familiar with sccm. We didn't want them in the interface where they could cause problems ( and the need to train them on all the nuances of it). During imaging we move servers through a few collections. Basic imaging, Drivers and firmware updates, application install, completed. 

This request was to come with another that i forgot to make a post about which would be the ability to query all collections, not just OSD collections. Between the 2 feature requests ( and without them, but since we were already using the web service it seamed fitting at least make the request) I would be able to make a simple interface in C# that met my teams needs. 

Coordinator
May 26, 2010 at 9:52 AM
Edited May 26, 2010 at 9:52 AM

Interesting idea. I will put this on the "wish-list" and see if I can implement it with the next release.

Regards

Maik

May 26, 2010 at 7:57 PM

Thank you  :)

Coordinator
Jun 21, 2010 at 6:44 PM
I have added both functions to a new Beta release. Want to give it a try? Regards Maik
Jun 24, 2010 at 6:52 PM

I am unfortunatly unable to test at the moment as i am on a break from work, I will try to contact a collegue and see i he can test it. Thankyou for adding these either way.

Sep 3, 2010 at 9:14 AM

So, I finally got to a position where i can test the new version. I am running into some problems with the getcollectionsfiltered (just testing from the web interface). after setting the debugging to debug instead of informational i get this.

2010-09-03 07:13:23.5713|INFO|MaikKoster.Deployment.SCCM.Controller|Current Scope is \\hidingservername\root\sms\site_hiddingsitecode.
2010-09-03 07:13:23.5713|DEBUG|MaikKoster.Deployment.SCCM.Controller|Adding Include/Exclude clause to supplied query "SELECT * FROM SMS_Collection WHERE". Include "", Exclude "".
2010-09-03 07:13:23.5713|DEBUG|MaikKoster.Deployment.SCCM.Controller|Returning query "SELECT * FROM SMS_Collection WHERE".
2010-09-03 07:13:23.5713|DEBUG|MaikKoster.Deployment.SCCM.Controller|Searching for Collections using query "SELECT * FROM SMS_Collection WHERE".
2010-09-03 07:13:23.5873|DEBUG|MaikKoster.Deployment.SCCM.Controller|Error Message: Generic failure
2010-09-03 07:13:23.5873|INFO|MaikKoster.Deployment.SCCM.Controller|No collection found.
2010-09-03 07:13:23.5873|INFO|MaikKoster.Deployment.WebService.SCCM|Found 0 collection(s)
2010-09-03 07:13:23.5873|DEBUG|MaikKoster.Deployment.WebService.SCCM|SetCachedNamespaces

 

I believe the generic failure is related to the hanging where clause. as i want to retrieve all collections at the moment, it would seem the where clause should only be added if there is an include specified.

 

Sep 4, 2010 at 7:56 AM

Perhaps i am attempting to use this option incorrectly. Today i tried to just make the include filter %, now i get this output in the debug logs.

Adding Include/Exclude clause to supplied query "SELECT * FROM SMS_Collection WHERE". Include "%", Exclude "".
2010-09-04 06:49:24.7796|DEBUG|MaikKoster.Deployment.SCCM.Controller|Returning query "SELECT * FROM SMS_Collection WHERE(Comment LIKE '%%%')".
2010-09-04 06:49:24.7796|DEBUG|MaikKoster.Deployment.SCCM.Controller|Searching for Collections using query "SELECT * FROM SMS_Collection WHERE(Comment LIKE '%%%')".
2010-09-04 06:49:25.2166|DEBUG|MaikKoster.Deployment.SCCM.Controller|Skipping Collection Root Collection(COLLROOT). Collection is not local to site code rr2.
2010-09-04 06:49:25.2166|DEBUG|MaikKoster.Deployment.SCCM.Controller|Skipping Collection All Systems(SMS00001). Collection is not local to site code rr2.
2010-09-04 06:49:25.2166|DEBUG|MaikKoster.Deployment.SCCM.Controller|Skipping Collection All Users(SMS00002). Collection is not local to site code rr2.
2010-09-04 06:49:25.2166|DEBUG|MaikKoster.Deployment.SCCM.Controller|Skipping Collection All User Groups(SMS00003). Collection is not local to site code rr2.
2010-09-04 06:49:25.2166|DEBUG|MaikKoster.Deployment.SCCM.Controller|Skipping Collection All Windows Workstation or Professional Systems(SMS00004). Collection is not local to site code rr2.
2010-09-04 06:49:25.2166|DEBUG|MaikKoster.Deployment.SCCM.Controller|Skipping Collection All Active Directory Security Groups(SMS00005). Collection is not local to site code rr2.
2010-09-04 06:49:25.2166|DEBUG|MaikKoster.Deployment.SCCM.Controller|Skipping Collection All Windows Server Systems(SMS000DS). Collection is not local to site code rr2.
2010-09-04 06:49:25.2166|DEBUG|MaikKoster.Deployment.SCCM.Controller|Skipping Collection All Windows 2000 Server Systems(SMS000HS). Collection is not local to site code rr2.
2010-09-04 06:49:25.2166|DEBUG|MaikKoster.Deployment.SCCM.Controller|Skipping Collection All Windows Server 2003 Systems(SMS000FS). Collection is not local to site code rr2.
2010-09-04 06:49:25.2166|DEBUG|MaikKoster.Deployment.SCCM.Controller|Skipping Collection All Desktops and Servers(SMSDM003). Collection is not local to site code rr2.
2010-09-04 06:49:25.2166|DEBUG|MaikKoster.Deployment.SCCM.Controller|Skipping Collection All Unknown Computers(SMS000UC). Collection is not local to site code rr2.

2010-09-04 06:49:25.2606|INFO|MaikKoster.Deployment.SCCM.Controller|No collection found.

I get the same output if i try using RR1 which is our primary site name.

 

Adding Include/Exclude clause to supplied query "SELECT * FROM SMS_Collection WHERE". Include "%", Exclude "".
2010-09-04 06:48:43.5925|DEBUG|MaikKoster.Deployment.SCCM.Controller|Returning query "SELECT * FROM SMS_Collection WHERE(Comment LIKE '%%%')".
2010-09-04 06:48:43.5925|DEBUG|MaikKoster.Deployment.SCCM.Controller|Searching for Collections using query "SELECT * FROM SMS_Collection WHERE(Comment LIKE '%%%')".
2010-09-04 06:48:43.6575|DEBUG|MaikKoster.Deployment.SCCM.Controller|Skipping Collection Root Collection(COLLROOT). Collection is not local to site code rr1.
2010-09-04 06:48:43.6575|DEBUG|MaikKoster.Deployment.SCCM.Controller|Skipping Collection All Systems(SMS00001). Collection is not local to site code rr1.
2010-09-04 06:48:43.6575|DEBUG|MaikKoster.Deployment.SCCM.Controller|Skipping Collection All Users(SMS00002). Collection is not local to site code rr1.
2010-09-04 06:48:43.6575|DEBUG|MaikKoster.Deployment.SCCM.Controller|Skipping Collection All User Groups(SMS00003). Collection is not local to site code rr1.
2010-09-04 06:48:43.6575|DEBUG|MaikKoster.Deployment.SCCM.Controller|Skipping Collection All Windows Workstation or Professional Systems(SMS00004). Collection is not local to site code rr1.
2010-09-04 06:48:43.6575|DEBUG|MaikKoster.Deployment.SCCM.Controller|Skipping Collection All Active Directory Security Groups(SMS00005). Collection is not local to site code rr1.
2010-09-04 06:48:43.6575|DEBUG|MaikKoster.Deployment.SCCM.Controller|Skipping Collection All Windows Server Systems(SMS000DS). Collection is not local to site code rr1.
2010-09-04 06:48:43.6575|DEBUG|MaikKoster.Deployment.SCCM.Controller|Skipping Collection All Windows 2000 Server Systems(SMS000HS). Collection is not local to site code rr1.
2010-09-04 06:48:43.6575|DEBUG|MaikKoster.Deployment.SCCM.Controller|Skipping Collection All Windows Server 2003 Systems(SMS000FS). Collection is not local to site code rr1.
2010-09-04 06:48:43.6575|DEBUG|MaikKoster.Deployment.SCCM.Controller|Skipping Collection All Desktops and Servers(SMSDM003). Collection is not local to site code rr1.
2010-09-04 06:48:43.6575|DEBUG|MaikKoster.Deployment.SCCM.Controller|Skipping Collection All Unknown Computers(SMS000UC). Collection is not local to site code rr1.

2010-09-04 06:48:43.6685|INFO|MaikKoster.Deployment.SCCM.Controller|No collection found.

Sep 4, 2010 at 7:56 AM

Cancel that last post, apparently site code is case sensitive. rr1 != RR!