PowerShell wrapper for CDS CrmServiceClient

Minimum PowerShell version


Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name Microsoft.Xrm.Tooling.CrmConnector.PowerShell

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name Microsoft.Xrm.Tooling.CrmConnector.PowerShell

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More



© 2022 Microsoft Corporation. All rights reserved

Package Details


  • Microsoft Common Data Service Team


Get-CrmConnection Get-CrmOrganizations




This module has no dependencies.

Release Notes

Current Release:
Updated User Password Authentication behavior to prefer OAuth for all Online Operations
Updated dependency for core sdk client
Resynced to 9.1.1.x CrmServiceClient
Updated for Current Dataverse SDK
Updated behavior of ImportSolutionAsync to leverage updated Dataverse behavior post 9.2 release.
Updated Display name for Northamerica 2 Region to reflect that it is more commonly know as GCC.
Updated Newtonsoft.Json to v11.0.2 to match Dataverse server.
Adding EnableAffinityCookie to allow for override of Affinity behavior when interacting with Dataverse.
   In general, users should not manipulate this property. more details can be found here:
Adding support for enhanced features for solution import.
Added support to auto retry 503 server unavailable network errors
Added support to allow for callers to add custom headers to the request to Dataverse - this is intended for Microsoft releated consumers only.
Fixed an issue where BypassPluginExecution property on request was not being understood properly by the server.
Updated minimum required Microsoft.Xrm.Sdk.dll assembly version to Microsoft.CrmSdk.CoreAssemblies.
Warning!, failure to update to this or higher level assembly will result in the following error:
       Method not found: void Microsoft.Xrm.Sdk.ParameterCollection.AddOrUpdateIfNotNull(System.String, System.Object).
Added new public property to Read out InMemory Logs in string list format or Tuple(datetime,logevent) format.
Added new public property for OrganizationDetail Information called "OrganizationDetail" for the currently connected environment.
Added new enum for ImportSolution additional property options called "ImportSolutionProperties" - this contains valid options for additional properties for the ImportSolution handler
Adding Switzerland Geo to Regions List.
Fixed an issue with .Clone not correctly supporting adding telemetry handlers to cloned connections
Fixed an issue with telemetry for the client that was using incorrect format for useragent content
Added initial support for in memory log capture support.

Fixed an issue with sovereign cloud discovery reference data that would prevent a login control from picking the correct global discovery server when connecting.
Fixed Authority property data loss post clone process
Fixed an error with connection string based IFD Auth flows that slipped though testing.
Fixed an error where discovery would be used when using AD and IFD to connect to onpremise even if connection strings where used.
Fixed an error where timeout property was not properly assigned when using Non-oAuth types
Fixed an error with setting CallerId when ClientSecret Auth type is used.  
Thanks for all the bug reports on this and repros that really helped us run it down.
Uptaking new CoreSDK release
Uptaking current CDS SDK.
Internal fixes to unify the way in which online and onprem instances were determined from the URI provided.
Added new Static Property on Utilities called IsValidOnlineHost, this takes a URL and determines if it a valid OnLine URI for the CDS Service
Corrected an issue where the AdminAPI URL provided by Get-CrmOrganizations was incorrect.
Fixed a bug Null Object Error that would occur occasionaly during connect when many concurrent connects were run.
This would typically happen if a developer used a Task.Wait behavior to create a stack of connections at once.
Fixed a bug that would prevent logs from being generated even when verbose tracing was enabled.
Added Support for new properties in discovery response.
Tenant Id - ID of the tenant that the instance resides in
Enviroment Id - ID of the PowerPlatform Envrioment that the instance resides in
UrlName - Host name for the target instance.
Fixed a bug where the second ( or third ) connection string attempt in the same process would cause the client to try to reuse the current connection.
Fixed a bug where the SDK Version Property was not properly returning from the CrmServiceClient
Fixed a bug with how errors are handled when they are raised from ADAL 3.19+.  MFA Force Login will now work properly again.
   Updated default response sizes to support more verbose error messages from CDS
ADAL 3.19+ is now required for this library.  ADAL 2.x clients will need to be updated to use ADAL 3.x+
Added Support for Current User ID login when using Online flows with oAuth (Login control/connection string support )
Added Support for ClientID Secret Auth when using oAuth flows. (connection string support )
Added support for France and New US Geos
Added new behavior to return the full login error when initial connect fails in LastException.
Fixed https activation issue introduced by .net 4.8. - This should no longer require http activation to be enabled on windows.
Fixed issue where a long running cloned connection loses its access token. - (Nuget-
Added native support for handing throttling messages from server.
Fixed issue where a cloned connections token could time out in a way that was not detected.
When failing, this would result in a mid operation Authentication failure reporting something like "Anonymous Access Failed"
Added Support for China Geo
Minor changes to logging of Import Solution Activities


NOTE: Notes Below are synced to Nuget Release Found here:
Fixed bug in CrmServiceClient which would cause some OnPrem connections to fail with an error "Item already added to List"
Minor Perf Improvements
Updated to include Fixed version of CrmServiceClient and login control for new US Geo ( US Gov High )
Picked up updated CrmServiceClient (Microsoft.Xrm.Tooling.Connector)
Picked up updated CrmServiceClient (Microsoft.Xrm.Tooling.Connector)
Picked up updated CrmServiceClient (Microsoft.Xrm.Tooling.Connector)
Fixed a bug with using ExecuteCrmWebRequest where SkipDiscovery was also used that would cause the command to fail with a malformed URI error.
Fix to support SSO login, issue manifested as unable to execute a SSO login on second attempt.
Fix to make local metadata cache instance aware,
Issue manifested in a single client process where more then one connection was made to different CDS instances and the metadata helpers were used.  The Metadata would not be instance specific.

Streamlined .Clone support by removing unneeded WhoAmI validation call.
Added new .Clone override to allow a developer to pass an assembly reference to the .Clone method to use when establishing strong types for that connection.
Added additional error log details when a fault is detected
Added support for retrying SDK request if the server throws a retriable errors.
ImportSolutionToCrmAsync –
Returns an AsyncOperation ID that must be polled for solution Import completion or failure.
Note, Async jobs are subject to Async queuing and overhead, thus use this with caution.
DeleteAndPromoteSolutionAsync –
Returns an AsyncOperation ID that must be polled for completion
Note: DeleteAndPromote Async support is not generally available to all regions and versions of the platform.  If this is not available the async job with fail immediately.
Note: Async jobs are subject to Async queuing and overhead, thus use this with caution.
Added new dependencies: version
Added Support for Caller ID using AAD Object ID of caller -
Added new property on CrmServiceClient: CallerAADObjectId
Supported for 8.1 and later.
Added New Method ExecuteCrmWebRequest
This method supports using the XRM WebAPI directly from the CRMServiceClient.
Supports only oAuth and Certificate Auth connection types
Supported for 8.0 and later.
Supports Common request types and supports batch execute.
Added Global Discovery Support for Instance lookup
Global discovery is now used for all lookup, both regional and global (Online Region = Dont Know) when OAuth is used, except where special region rules are required.
Note: Germany and North America 2 are not scanned when Online Region = Dont Know is selected.
Added SkipDiscovery to all connection string variants.
Added Certificate support for constructor variants.
Fixed issue with allowing discovery selection using onPrem and OAuth.
Fixed an issue with older On-Prem ADFS instances that do not require a resource URI.

**Special notes:
Added additional telemetry support to connection requests
This will add the process name of the calling process (if available) to help with troubleshooting and support requests.
Added request IDs to all requests to help with troubleshooting and support requests.
These will appear only when verbose logging is enabled.
       9.0 Initial Release
Initial release.
To register module, run the RegisterXrmTooling.ps1


  • Microsoft.Xrm.Tooling.CrmConnector.PowerShell.nuspec
  • Microsoft.Bcl.AsyncInterfaces.dll
  • Microsoft.Crm.Sdk.Proxy.dll
  • Microsoft.IdentityModel.Clients.ActiveDirectory.dll
  • Microsoft.Xrm.Tooling.CrmConnector.PowerShell.psd1
  • Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll
  • Microsoft.Xrm.Tooling.CrmConnector.PowerShell.psm1
  • Microsoft.QualityTools.Testing.Fakes.dll
  • Microsoft.Xrm.Tooling.Ui.Styles.dll
  • Microsoft.Rest.ClientRuntime.dll
  • Newtonsoft.Json.dll
  • Microsoft.Xrm.Sdk.Deployment.dll
  • System.Buffers.dll
  • Microsoft.Xrm.Sdk.dll
  • System.Memory.dll
  • Microsoft.Xrm.Sdk.Workflow.dll
  • System.Numerics.Vectors.dll
  • Microsoft.Xrm.Tooling.Connector.dll
  • System.Runtime.CompilerServices.Unsafe.dll
  • Microsoft.Xrm.Tooling.CrmConnectControl.dll
  • System.Text.Encodings.Web.dll
  • System.Text.Json.dll
  • Microsoft.Xrm.Tooling.CrmConnector.Powershell.dll
  • System.Threading.Tasks.Extensions.dll
  • Microsoft.Xrm.Tooling.CrmConnector.Powershell.dll-Help.xml
  • System.ValueTuple.dll

Version History

Version Downloads Last updated (current version) 412,135 11/28/2023 38,188 11/8/2023 164,446 7/20/2023 90,353 4/21/2023 885 4/20/2023 31,716 3/13/2023 208,386 7/12/2022 934,705 4/29/2021 129,317 11/18/2020 212,021 8/13/2020 18,379 7/15/2020 24,861 7/1/2020 8,738 6/12/2020 6,459 6/2/2020 22,746 4/20/2020 194 4/20/2020 23,277 3/25/2020 545,831 2/11/2020 793 2/7/2020 10,547 12/18/2019 2,855 12/5/2019 10,541 10/26/2019 128,572 9/12/2019 1,842 7/17/2019 79,167 2/27/2019
Show more