Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get a list of users with the Core Service?

I'm trying to get a list of the available users from the Core Service. I spend quite some time looking at the available service methods and the most obvious seemed to be this:

TrusteesFilterData trusteesFilterData = new TrusteesFilterData
                                        {
                                            BaseColumns = ListBaseColumns.IdAndTitle,
                                            IsPredefined = false,
                                            ItemType = ItemType.User
                                        };
XElement listTrustees = client.GetSystemWideListXml(trusteesFilterData);

However, the code throws an error when calling GetSystemWideListXml - Unable to create Abstract Class. Am I using the correct approach and, if so what am I doing wrong? If not, what should I be doing instead?

like image 804
Jeremy Grand-Scrutton Avatar asked Oct 25 '12 16:10

Jeremy Grand-Scrutton


1 Answers

Take a look at the samples in the open source project for workflow notification

http://code.google.com/p/tridion-notification-framework/source/browse/NotificationService/NotificationService/Worker.cs

Lines 22 - 26 in the DoWork() method should do what you need - I think need to use UsersFilterData rather than TrusteesFilterData

var users = client.GetSystemWideList(new UsersFilterData { BaseColumns = ListBaseColumns.IdAndTitle, IsPredefined = false });
like image 50
Chris Summers Avatar answered Nov 16 '22 05:11

Chris Summers