Query the list of available organizations

Hi,

is there any way to query the list of organizations available on a GroupShare server via the Studio API?

I know that this can be done through the REST API, but some features are available only in the Studio API, and it would be better not mixing the two.

Thanks,

Tamas

  • I believe you can use ProjectServer.GetServerProjects to get something close to that:
    http://producthelp.sdl.com/SDK/ProjectAutomationApi/3.0/html/b0623918-8bd8-2d94-af95-7c9905dfc084.htm

    The key is to pass "/" to start at the root:

    ProjectServer server = new ProjectServer(address, false, "MYUSERNAME", "MYPASSWORD");

    var projects = server.GetServerProjects("/", true, true);

    string[] organizations = projects.Select(proj => proj.OrganizationPath).Distinct().ToArray();

    However, the above is not perfect though, you may have an organization that contains no projects. This is why it would be better to use the REST API.