Hosted Office Communications Server::Unsubscribe

This procedure unsubscribes from the Hosted Office Communications Server service.

Use this procedure to remove the Office Communications Server Hosted Service subscription from an organization.

Arguments

Input argument Required Type Description

<organization>

Yes

string

The Lightweight Directory Access Protocol (LDAP) path of the organization.

<preferredDomainController>

Yes

string

The domain controller to use for Active Directory actions.

Remarks

Security

The caller must be at least a member of role: Customer Administrator

Permission Check

No explicit permission check is required for this procedure. The procedure calls Managed Plans::RemovePlanFromCustomer which tests the caller for the Customer Administrator (UserCreators).

Preconditions

The specified organization was previously subscribed to the service.

Business Rules

The organization cannot be unsubscribed from the service if any users in the organization are enabled for the service.

Post-conditions

  • The Office Communications Server plan is no longer assigned to the organization.

  • The Office Communications Server users plans assigned to the Available Plan list of the organization are removed from that list.

  • The SIP Domains which belong to the organization are removed.

  • The Office Communications Server Pool assignment for the organization is removed.

Sequence Narrative

  1. Actor submits Unsubscribe request to the Hosted Office Communications Server namespace.

  2. The Unsubscribe procedure calls the GetOrganizationPlanAssignment procedure, which will retrieve the plan assigned to the organization. This validates that the organization is subscribed to the Office Communications Server service.

  3. The Unsubscribe procedure calls Managed Plans::ExecPlanSQL_ to execute the new stored procedure spCountOrgUsersByPlanType. The planTypeName = 'OCSUserHosting'. This will return a count of the users with an active OCSUserHosting plan assignment.

  4. Alt: If the count returned by Managed Plans::ExecPlanSQL_ is greater than 0, then an InvalidOperationException (0x80131509) is raised. The exception states that the operation cannot be performed until the users have been deleted with DeleteSipDomain.

  5. The Unsubscribe procedure calls the GetOrganizationAvailablePlans. This will return zero or more available plans assigned to the organization.

  6. For each availablePlans/planName, the Unsubscribe procedure calls the Managed Plans::SetAvailablePlanStatus with statusTypeName="Deleted".

  7. The Unsubscribe procedure calls Managed Plans::RemovePlanFromCustomer with the planName equal to the planName value returned by GetOrganizationPlanAssignment.

  8. The Unsubscribe procedure calls Managed Office Communications Server::GetSipDomainsByOrganization. This will return zero or more Sip Domains assigned to the organization.

  9. For each sipDomains/sipDomain, the Unsubscribe procedure calls Managed Office Communications Server::DeleteSipDomain if the SIP domain is owned by the organization.

  10. The Unsubscribe procedure calls Managed Office Communications Server::DeletePoolAssignment to remove the pool assignment. If there was one it would be deleted if not then it would do nothing.

Exceptions

HResult Message Conditions

0x80131509

Unable to unsubscribe the organization from the Hosted Office Communications Service Plan. One or more users with a OCSUserHosting plan were found in the organization. These users must be disabled for the service with the DeleteSipUser procedure.

An attempt was made unsubscribe an organization from the OCS service, but that organization still has users with OCSUserPlans assigned.

Sample Code

Example XML Request

<request> 
  <data> 
    <!--GUID of the organization (must be supplied if organization is absent).--> 
    <GUID>cd2bfd08d6dc804d9cd41e88069e37f8</GUID> 
    <!--The LDAP path of the customer organization in the Service Provider domain (must be supplied if GUID is absent).--> 
    <organization>LDAP://OU=AlpineSkiHouse,OU=ConsolidatedMessenger,OU=Hosting,DC=Fabrikam,DC=Com</organization> 
    <!--The name of the preferred domain controller in the Service Provider domain.--> 
    <preferredDomainController>AD01.Fabrikam.Com</preferredDomainController> 
  </data> 
  <procedure> 
    <execute namespace="Hosted Office Communications Server" procedure="Unsubscribe" impersonate="1"> 
      <before source="data" sourcePath="GUID" destination="executeData" mode="move" /> 
      <before source="data" sourcePath="organization" 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

<response>  
        <data /> 
</response> 

Applies To

Hosted Office Communications Server Namespace API for:

  • Hosted Messaging and Collaboration version 4.5

See also

Tasks

Hosted Office Communications Server::Subscribe