Command line tool for Dynamics 365. Because the command line is cool again!
Download the latest release of the program from GitHub. Unzip the contents to any folder and open a console in that directory.
Type xrm and the command you want to use.
xrm [command] [--option optionvalue]
To view a list of available commands type help
xrm help
To view a list of available options for each command type the command and --help
xrm command --help
You can add it to your project as a nuget package too
PM > Install-Package XrmCommandBox
Then, it will be available in the following directory, related to your project
..\packages\XrmCommandBox.X.X.X\tools\xrm.exe
(Replace X.X.X by the version of XrmToolbox Installed)
Imports N to N relationshipts to CRM
Options:
-f, --file File containing the data to import
-e, --continue-on-error Continue if there's an error while processing the command
-c, --connection Required. Connection string, or name of a connection string to use
-l, --log-level Sets the current logging output. Can be Debug, Info, Error
Updates a specific column from a data table querying data in CRM
Options:
-f, --file File containing the data table with the data
-l, --column Required. Name of the column to lookup
-n, --entity Name of the entity where search for the data
-m, --match-attributes Attributes used to know if the record exists. Default is display attribute
-y, --match-columns Columns containing the with the data to lookup. The number of columns must match the
number of matching attributes
-e, --continue-on-error Continue if there's an error while processing the command
-c, --connection Required. Connection string, or name of a connection string to use
-f, --config-file Xml file containing the command options
-l, --log-level Sets the current logging output. Can be Debug, Info, Error
Publishes all existing customizations in the environment
Options:
-c, --connection Required. Connection string, or name of a connection string to use
-f, --config-file Xml file containing the command options
-l, --log-level Sets the current logging output. Can be Debug, Info, Error
Delete all the records returned by the specified query
Options:
-q, --fetch-query Fetch query to retrieve the records to delete
-e, --continue-on-error Continue if there's an error while processing the command
-c, --connection Required. Connection string, or name of a connection string to use
-f, --config-file Xml file containing the command options
-l, --log-level Sets the current logging output. Can be Debug, Info, Error
Exports an entity or query from CRM to a file
Options:
-r, --row-number Adds the row number to each exported record
-f, --file Path of the file where to save the exported data
-e, --entity Name of the entity you want to export
-q, --fetch-query Fetch query to retrieve the records to export
-s, --page-size (Default: 5000) Number of records to retrieve from a page
-p, --page Page of records to retrieve
-c, --connection Required. Connection string, or name of a connection string to use
-f, --config-file Xml file containing the command options
-l, --log-level Sets the current logging output. Can be Debug, Info, Error
Example:
xrm export --connection DEV --entity account --file Accounts.xml --log-level Info --page 1 --page-size 5000
Imports information from a file to Dynamics
Options:
-f, --file File containing the data to import
-e, --continue-on-error Continue if there's an error while processing the command
-m, --match-attributes Attributes used to know if the record exists. Default is id attribute
-c, --connection Required. Connection string, or name of a connection string to use
-f, --config-file Xml file containing the command options
-l, --log-level Sets the current logging output. Can be Debug, Info, Error
Imports the specified solution .zip file into CRM
Options:
-s, --solution-file Required. .zip file containing the solution to import
-a, --async Indicates wether the import should be performed asynchronously
-c, --connection Required. Connection string, or name of a connection string to use
-f, --config-file Xml file containing the command options
-l, --log-level Sets the current logging output. Can be Debug, Info, Error
Export the specified solution to a .zip file
Options:
-s, --solution-name Required. Unique name of the solution to export
-c, --connection Required. Connection string, or name of a connection string to use
-f, --config-file Xml file containing the command options
-l, --log-level Sets the current logging output. Can be Debug, Info, Error