Ready to get started?

Learn more about the CData ADO.NET Provider for SuiteCRM or download a free trial:

Download Now

Automate SuiteCRM Integration Tasks from PowerShell

Are you looking for a quick and easy way to access SuiteCRM data from PowerShell? We show how to use the Cmdlets for SuiteCRM and the CData ADO.NET Provider for SuiteCRM to connect to SuiteCRM data and synchronize, automate, download, and more.

The CData Cmdlets for SuiteCRM are standard PowerShell cmdlets that make it easy to accomplish data cleansing, normalization, backup, and other integration tasks by enabling real-time and bidirectional access to SuiteCRM.

Cmdlets or ADO.NET?

The cmdlets are not only a PowerShell interface to the SuiteCRM API, but also an SQL interface; this tutorial shows how to use both to create, retrieve, update, and delete SuiteCRM data. We also show examples of the ADO.NET equivalent, which is possible with the CData ADO.NET Provider for SuiteCRM. To access SuiteCRM data from other .NET applications, like LINQPad, use the CData ADO.NET Provider for SuiteCRM.

After obtaining the needed connection properties, accessing SuiteCRM data in PowerShell consists of three basic steps.

The User and Password properties must be set to valid SuiteCRM user credentials. Additionally, specify the URL to the SuiteCRM application, for example

Note that retrieving SuiteCRM metadata can be expensive. It is advised that you store the metadata locally as described in the Caching Metadata section of the data provider help documentation.


  1. Install the module:

    Install-Module SuiteCRMCmdlets
  2. Connect:

    $suitecrm = Connect-SuiteCRM -URL "$URL" -User "$User" -Password "$Password"
  3. Search for and retrieve data:

    $industry = "Manufacturing" $accounts = Select-SuiteCRM -Connection $suitecrm -Table "Accounts" -Where "Industry = `'$Industry`'" $accounts

    You can also use the Invoke-SuiteCRM cmdlet to execute SQL commands:

    $accounts = Invoke-SuiteCRM -Connection $suitecrm -Query 'SELECT * FROM Accounts WHERE Industry = @Industry' -Params @{'@Industry'='Manufacturing'}


  1. Load the provider's assembly:

    [Reflection.Assembly]::LoadFile("C:\Program Files\CData\CData ADO.NET Provider for SuiteCRM\lib\System.Data.CData.SuiteCRM.dll")
  2. Connect to SuiteCRM:

    $conn= New-Object System.Data.CData.SuiteCRM.SuiteCRMConnection("URL=;User=myUser;Password=myPassword;") $conn.Open()
  3. Instantiate the SuiteCRMDataAdapter, execute an SQL query, and output the results:

    $sql="SELECT Name, Industry from Accounts" $da= New-Object System.Data.CData.SuiteCRM.SuiteCRMDataAdapter($sql, $conn) $dt= New-Object System.Data.DataTable $da.Fill($dt) $dt.Rows | foreach { Write-Host $ $_.industry }

Update SuiteCRM Data


Update-SuiteCRM -Connection $SuiteCRM -Columns @('Name','Industry') -Values @('MyName', 'MyIndustry') -Table Accounts -Id "MyId"


$cmd = New-Object System.Data.CData.SuiteCRM.SuiteCRMCommand("UPDATE Accounts SET Industry='Manufacturing' WHERE Id = @myId", $conn) $cmd.Parameters.Add(new System.Data.CData.SuiteCRM.SuiteCRMParameter("@myId","10456255-0015501366")) $cmd.ExecuteNonQuery()

Insert SuiteCRM Data


Add-SuiteCRM -Connection $SuiteCRM -Table Accounts -Columns @("Name", "Industry") -Values @("MyName", "MyIndustry")


$cmd = New-Object System.Data.CData.SuiteCRM.SuiteCRMCommand("INSERT INTO Accounts (Industry) VALUES (@myIndustry)", $conn) $cmd.Parameters.Add(new System.Data.CData.SuiteCRM.SuiteCRMParameter("@myIndustry","Manufacturing")) $cmd.ExecuteNonQuery()

Delete SuiteCRM Data


Remove-SuiteCRM -Connection $SuiteCRM -Table "Accounts" -Id "MyId"


$cmd = New-Object System.Data.CData.SuiteCRM.SuiteCRMCommand("DELETE FROM Accounts WHERE Id=@myId", $conn) $cmd.Parameters.Add(new System.Data.CData.SuiteCRM.SuiteCRMParameter("@myId","001d000000YBRseAAH")) $cmd.ExecuteNonQuery()