Author Topic: How to Read all agent of a Agent Grroup (or Group Target)  (Read 2790 times)

Offline fabio.meschini

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
How to Read all agent of a Agent Grroup (or Group Target)
« on: January 19, 2015, 05:32:47 PM »
Hi all,

i'm using the 7.6 psdk api and i need to read on configuration server all information regarding all agent contained into a VAG or GT.

I think that i need to do 2 different requests (RequestReadObject), one for retrieving the VAG (CfgAgentGroup) and the 2nd request for filtering the agent (CfgPerson).
Can anybody suggest me a way for retrieve agents information throught a single request? I'm evaluating also a possibile upgrade of the psdk api.

Thanks a lot,

FABIO

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: How to Read all agent of a Agent Grroup (or Group Target)
« Reply #1 on: January 20, 2015, 06:26:36 AM »
do not know PSDK 7.6 a lot, but within latest PSDK versions you can use CfgQuery and get/filter data at one "place". Try to read doc about it.

Offline kerry.finlayson

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: How to Read all agent of a Agent Grroup (or Group Target)
« Reply #2 on: January 21, 2015, 07:32:08 AM »
Hi Fabio,

I am using a later version of the psdk but this is how we retrieve the agent username from a particular VAG:

CfgAgentGroupQuery agentGroupQuery = new CfgAgentGroupQuery(_confService);
                agentGroupQuery.Name = vagid;
                CfgAgentGroup agentGroup = _confService.RetrieveObject<CfgAgentGroup>(agentGroupQuery);
                List<string> agentList = new List<string>();
                foreach (var agent in agentGroup.Agents)
                    agentList.Add(agent.UserName);
                return agentList;

Hope that helps,
Kerry.

Offline fabio.meschini

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
Re: How to Read all agent of a Agent Grroup (or Group Target)
« Reply #3 on: January 23, 2015, 09:15:14 AM »
Thank you so much for your replies.
I've decided to upgrade psdk for using confservice and CfgQueries as you suggest me.
Thank you!
Fabio