Where to find Server Address And Organization Name in plugin?

Where to find Server Address And Organization Name in plugin?

If you would create client application which use OrganizationServiceProxy answer to question is easy: var proxy = service as OrganizationServiceProxy; var scheme = proxy.EndpointSwitch.PrimaryEndpoint.Scheme; var serverAddress = proxy.EndpointSwitch.PrimaryEndpoint.Host; var organizationName = proxy.EndpointSwitch.PrimaryEndpoint.Segments.Length < 2 ? UndefinedValue : proxy.EndpointSwitch.PrimaryEndpoint.Segments[1].Replace("/", string.Empty); If you use LocalPluginContext organization name is available: localContext.PluginExecutionContext.OrganizationName But, what with other parameters, ex. servername […]

LookupAccountName failed with error, systemuser entity

LookupAccountName failed with error, systemuser entity

Info: Recently I came across that error at SystemUser creation pipeline. Reason: Wrong domain has been specified and/or user doesn’t exists in ActiveDirectory. Solution: Ensure correct domain prefix is specified and user actually exists in AD and is enabled. CrmVersion: 2011 OnPremises StackTrace info: at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Create(Entity entity, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType) at Microsoft.Crm.Extensibility.InprocessServiceProxy.CreateCore(Entity […]