Monday, November 2, 2015

Microsoft Dynamics CRM getting organization(s) endpoint

Microsoft Dynamics CRM Online gives you options for segregating your CRM data and user access. For most companies, adding and using multiple instances in your subscription provides the right mix of functionality and ease of management. Enterprises with separate geographic locations might consider using multiple tenants to separate Microsoft Dynamics CRM Online licenses. Multiple instances can share users among instances; multiple tenants cannot.

In order to get instances (Organization) configured in your account we use discovery service. Discovery service provides the organizations that are available on your Microsoft Dynamics Server. It uses SOAP protocol. 

Given below list of discovery service (Online) hosted by Microsoft for different geo locations.

LocationDiscovery Web service URLIdentity Provider
North America
Microsoft account
Microsoft Office 365
North America 2
Microsoft Office 365
Europe, Middle East and Africa (EMEA)
Microsoft account
Microsoft Office 365
Asia Pacific Area (APAC)
Microsoft account
Microsoft Office 365
Microsoft Office 365
Japan (JPN)
Microsoft Office 365
South America
Microsoft Office 365
For On-Premise the URL would be: 

Code to get organization endpoints for all the instances configured in Microsoft Dynamics CRM Online.

string discoveryURL =";                 
//Pass your online account credentials           
ClientCredentials credentials = new ClientCredentials();
credentials.UserName.UserName = "";
credentials.UserName.Password = "xxxxxxxxxxx";

//Create discovery service proxy
DiscoveryServiceProxy dsp = new DiscoveryServiceProxy(new Uri(discoveryURL), null, credentials, null);
//Retrieve Organization details
RetrieveOrganizationsRequest orgRequest = new RetrieveOrganizationsRequest();
RetrieveOrganizationsResponse allOrgs = (RetrieveOrganizationsResponse)dsp.Execute(orgRequest);
//Print all organization(s)(instances) endpoint.
foreach (OrganizationDetail orgInfo in allOrgs.Details)


No comments:

Post a Comment