Exchange 2007 Resource Manager::QueryConsumersByOrganization

This procedure returns the mailboxes and public folders owned by an organization.

It returns all consumers (mailboxes and public folders) of an organization or tenant by either an orgGUID or the currently accepted organization parameter.

This procedure for Hosted Messaging and Collaboration version 4.5 handles the scenario where either the organization GUID or or a mailbox GUID cannot be found in Active Directory. This scenario is indicated by presenting an empty path in the output. An empty path node indicates an "orphaned" Organization or Mailbox.

Arguments

Input Schema for Hosted Messaging and Collaboration version 4.0 and earlier

Input Arguments Type Value Range Description

<preferredDomainController>

string

0..1

The Fully Qualified Domain Names (FQDN) or IP Address of the domain controller to use for this procedure.

<GUID>

string

0..1

The GUID for the public store, mailstore, or mailbox.

<organization>

string

0..1

The Lightweight directory access protocol (LDAP) path of the organization or a container element for organization properties elements.

Input Schema for Hosted Messaging and Collaboration version 4.5

Input Arguments Type Value Range Description

<preferredDomainController>

string

0..1

The domain controller to use for Active Directory operations. Use the fully qualified domain name (FQDN) of the domain controller that you want to use.

<GUID>

string

0..1

The GUID for the public store, mailstore, or mailbox.

<organization>*

*Required if orgGUID is not specified

string

0..1

The Lightweight directory access protocol (LDAP) path of the organization to query in Resource Manager (RM).

<orgGUID>*

*Required if organization is not specified

string

0..1

The GUID of the organization to query in RM.

GUID should only be specified when the organization object is no longer found in Active Directory. That is, Organization has been orphaned in RM .

If both orgGUID and organization are supplied, orgGUID takes precedence, organization is ignored.

Output Schema for Hosted Messaging and Collaboration version 4.0 and earlier

Output Arguments Type Value Range Description

<organization>

string

1..1

The LDAP path of the organization or a container element for organization properties elements.

<mailboxes>

string

1..1

The container element for a collection of mailbox elements.

<mailboxes/ mailbox>

string

0..unbounded

The LDAP path for the Active Directory object or a Container element for an instance of mailbox properties elements.

<mailboxes/ mailbox/ GUID>

string

1..1

The GUID for the public store, mailstore, or mailbox.

<mailboxes/ mailbox/ path>

string

1..1

The LDAP path for the mailbox or organization.

<mailboxes/ mailbox/ kilobytes>

string

1..1

The storage required or allocated to the mailbox.

<publicFolders>

string

1..1

Container element for a collection of publicFolder elements.

<publicFolders/ publicFolder>

string

0..unbounded

Container element for a single instance of public folder properties elements.

<publicFolders/ publicFolder/ GUID>

string

0..1

The GUID for the public store, mailstore, or mailbox..

<publicFolders/ publicFolder/ folderPath>

string

0..1

The path of the folder.

<publicFolders/ publicFolder/ megabytes>

string

0..1

The storage required or allocated to the public folder.

Output Schema for Hosted Messaging and Collaboration version 4.5

Output Arguments Type Value Range Description

<organization>

string

1..1

The LDAP path of the organization or a container element for organization properties elements.

NOTE: It will be empty if organization instance is orphaned (not found in Active Directory).

<orgGUID>

string

1..1

The GUID of the organization or a container element for organization properties elements.

<mailboxes>

string

1..1

The container element for a collection of mailbox elements.

<mailboxes/ mailbox>

string

0..unbounded

The LDAP path for the Active Directory object or a Container element for an instance of mailbox properties elements.

<mailboxes/ mailbox/ GUID>

string

1..1

The GUID for the mailbox.

<mailboxes/ mailbox/ path>

string

1..1

The LDAP path for the mailbox or organization.

Note: It will be empty if the mailbox instance is orphaned (not found in Active Directory)

<mailboxes/ mailbox/ kilobytes>

string

1..1

The storage required or allocated to the mailbox.

<publicFolders>

string

1..1

The container element for a collection of publicFolder elements.

<publicFolders/ publicFolder>

string

0..unbounded

The container element for a single instance of public folder properties elements.

<publicFolders/ publicFolder/GUID>

string

0..1

The GUID of a Public folder.

<publicFolders/ publicFolder/folderPath>

string

0..1

The Path of the Public folder.

<publicFolders/ publicFolder/Megabytes>

string

0..1

The size of the Public folder.

Remarks

This procedure handles the scenario where either the organization GUID cannot be found in Active Directory or a mailbox GUID (Active Directory user object GUID from ExchMailbox07) cannot be found in Active Directory by presenting an empty path in the output. An empty path node will be indication of an "orphaned" Organization or Mailbox.

Security for Hosted Messaging and Collaboration version 4.0 and earlier

The caller must be at least a member of role: UserCreators

Security for Hosted Messaging and Collaboration version 4.5

If organization is specified, there will be no explicit permissions tests, effective permissions is UserCreators.

If orgGUID is specified, procedure must test for more restrictive DomainAdmins.

Error Handling

Error Condition Error Text

Organization instance not found

Organization Instance %GUID% or %Path% not found in Exchange 2007 Resource Manager.

Neither orgGUID nor organization specified

You must supply either a <orgGUID> or <organization> element.

Sample Code

Example XML Request 1

<request>  
        <data>  
                <organization>LDAP://OU=AlpineSkiHouse,ou=ConsolidatedMessenger,ou=Hosting,dc=Fabrikam,dc=com </organization> 
                <preferredDomainController>AD01.fabrikam.com </preferredDomainController> 
        </data> 
        <procedure>  
                <execute namespace="Exchange 2007 Resource Manager" procedure="QueryConsumersByOrganization" impersonate="1" >  
                        <before source="data" destination="executeData" mode="merge" /> 
                        <after source="executeData" destination="data" mode="merge" /> 
                </execute> 
        </procedure> 
</request> 

Example XML Request 2

<request> 
  <data> 
    <!--GUID of the organization to query in RM. --> 
    <orgGUID>D387F793E56BD043989EE82B6F334F1A</orgGUID> 
    <!-- 
                    The FQDN or IP Address of the domain controller to use for this procedure. 
                  --> 
    <preferredDomainController>AD01.Fabrikam.Com</preferredDomainController> 
  </data> 
  <procedure> 
    <execute namespace="Exchange 2007 Resource Manager" procedure="QueryConsumersByOrganization" impersonate="1"> 
      <before source="data" sourcePath="orgGUID" destination="executeData" mode="move" /> 
      <before source="data" sourcePath="preferredDomainController" destination="executeData" mode="move" /> 
      <after source="executeData" destination="data" mode="merge" /> 
    </execute> 
  </procedure> 
</request>

Example XML Response 1

<response> 
  <data> 
    <!--GUID of the organization to query in RM. --> 
    <orgGUID>D387F793E56BD043989EE82B6F334F1A</orgGUID> 
    <!-- 
                    Container element for a collection of mailbox elements. 
                  --> 
    <mailboxes> 
      <!-- 
                          The LDAP path for the Active Directory object or a Container element for an instance of mailbox properties elements. 
                        --> 
      <mailbox> 
        <GUID>2485E2F23BAE4562BE7BA3952228E697</GUID> 
        <path>LDAP://CN=KimA@AlpineSkiHouse.com,OU=AlpineSkiHouse,OU=ConsolidatedMessenger,OU=Hosting,DC=Fabrikam,DC=Com</path> 
        <kilobytes>10240</kilobytes> 
      </mailbox> 
    </mailboxes> 
    <!-- 
                    Container element for a collection of publicFolder elements. 
                  --> 
    <publicFolders> 
      <!-- 
                          Container element for a single instance of public folder properties elements. 
                        --> 
      <publicFolder> 
        <GUID>2485E2F23BAE4562BE7BA3952228E777</GUID> 
        <path>\AlpineSkiHouse\Legal</path> 
        <megabytes>6</megabytes> 
      </publicFolder> 
    </publicFolders> 
  </data> 
</response> 

Applies To

Exchange 2007 Resource Manager Namespace for:

  • Hosted Messaging and Collaboration version 4.5

  • Hosted Messaging and Collaboration version 4.0

See also

Tasks

Exchange 2007 Resource Manager::QueryConsumerMailboxAllocation
Exchange 2007 Resource Manager::QueryConsumerMailboxesByMailstore