esemény
Power BI DataViz világbajnokság
febr. 14. 16 - márc. 31. 16
4 esélye, hogy belépjen, nyerhet egy konferenciacsomagot, és bejuthat a LIVE Grand Finale-be Las Vegasban
További információEzt a böngészőt már nem támogatjuk.
Frissítsen a Microsoft Edge-re, hogy kihasználhassa a legújabb funkciókat, a biztonsági frissítéseket és a technikai támogatást.
This sample code shows how to use the discovery service with the CrmServiceClient.DiscoverGlobalOrganizations Method.
Megjegyzés
This sample is limited to .NET Full Framework. There is a newer sample compatible with .NET Core using the Dataverse.Client.ServiceClient.DiscoverOnlineOrganizationsAsync Method. See Sample: Global Discovery Service (C#).
This sample will not open dialog to prompt you for connection information.
If you have set and values in the App.config connection strings, it will use them. Otherwise, set the username
and password
variables in the SampleProgram.Main
method.
This sample uses the SDK Assembly CrmServiceClient
to query the global discovery service with a user's credentials to determine which environments they can connect with.
If one or more environments are returned, the sample will prompt the user to choose one, and then use a WhoAmIRequest
to return the SystemUser.UserId
for that environment.
In order to simulate the scenario described in What this sample does, the sample will do the following:
This sample requires no special setup except that there are valid user credential username and password to use.
If you know the regional data center that your environments are in, the sample will run faster if you set this value at line 40 of the SampleProgram.cs file.
In SampleMethods.cs there is a Clouds
enumeration for each of the known global discovery centers. Each enumeration member is decorated with a Description
notation. All of these members except Unknown
have the URL for the global discovery service set as the description.
Using the user credentials and the cloud
value, the program uses the GetAllOrganizations
static method to retrieve all known environments for the user.
The GetAllOrganizations
method detects whether the cloud
value is set to Cloud.Unknown
. If it is set to this member, this method will choose the commerical Cloud
enum and retrieve any environments that are found using the GetOrganizationsForCloud
static method.
If a specific data center is set, GetAllOrganizations
will simply call GetOrganizationsForCloud
with those values.
The GetOrganizationsForCloud
method extracts the cloud's discovery service Url from the member Description
decoration and uses it together with the user credentials to execute the DiscoverGlobalOrganizations
CrmServiceClient helper message.
A System.ServiceModel.Security.SecurityAccessDeniedException
is expected when the user has no environments in a specific data center.
If any environments are returned by the GetAllOrganizations
method, they will be listed in the console and you will be prompted to choose one by typing a number. If your choice is valid, the selected environment data is used to execute a WhoAmIRequest
and return the SystemUser.UserId
for the user in that environment.
This sample creates no records. No cleanup is required.
Discover user organizations
Sample: Global Discovery Service (C#)
Sample: Blazor WebAssembly with Global Discovery
esemény
Power BI DataViz világbajnokság
febr. 14. 16 - márc. 31. 16
4 esélye, hogy belépjen, nyerhet egy konferenciacsomagot, és bejuthat a LIVE Grand Finale-be Las Vegasban
További információOktatás
Modul
Use Dataverse Organization service - Training
Learn to use the Dataverse Organization service.
Tanúsítvány
Microsoft Certified: Dynamics 365 Ügyfélszolgálati funkcionális tanácsadó munkatárs - Certifications
Fejlesztheti az ügyfélszolgálati funkciók üzleti folyamatait, például az automatikus esetlétrehozási és üzenetsor-kezelést a Microsoft Dynamics 365 Ügyfélszolgálattal.