![]() |
VOOZH | about |
The CData Cmdlets Module for Certinia is a standard PowerShell module offering straightforward integration with Certinia. Below, you will find examples of using our Certinia Cmdlets with native PowerShell cmdlets.
There are several authentication methods available for connecting to Certinia: login credentials, SSO, and OAuth.
Set the User and Password to your login credentials. Additionally, set the SecurityToken. By default, the SecurityToken is required, but you can make it optional by allowing a range of trusted IP addresses.
To disable the security token:
To obtain the security token:
If you do not have access to the user name and password or do not want to require them, use the OAuth user consent flow. See the OAuth section in the Help for an authentication guide.
Set UseSandbox to true (false by default) to use a Certinia sandbox account. Ensure that you specify a sandbox user name in User.
$conn = Connect-Certinia -User "$User" -Password "$Password" -Security Token "$Security Token" -InitiateOAuth "$InitiateOAuth"
Follow the steps below to retrieve data from the Account table and pipe the result into to a CSV file:
Select-Certinia -Connection $conn -Table Account | Select -Property * -ExcludeProperty Connection,Table,Columns | Export-Csv -Path c:\myAccountData.csv -NoTypeInformation
You will notice that we piped the results from Select-Certinia into a Select-Object cmdlet and excluded some properties before piping them into an Export-Csv cmdlet. We do this because the CData Cmdlets append Connection, Table, and Columns information onto each "row" in the result set, and we do not necessarily want that information in our CSV file.
The Connection, Table, and Columns are appended to the results in order to facilitate piping results from one of the CData Cmdlets directly into another one.The following line deletes any records that match the criteria:
Select-Certinia -Connection $conn -Table Account -Where "Industry = Floppy Disks" | Remove-Certinia
The cmdlets make data transformation easy as well as data cleansing. The following example loads data from a CSV file into Certinia, checking first whether a record already exists and needs to be updated instead of inserted.
Import-Csv -Path C:\MyAccountUpdates.csv | %{
$record = Select-Certinia -Connection $Certinia -Table Account -Where ("Id = `'"+$_.Id+"`'")
if($record){
Update-Certinia -Connection $certinia -Table Account -Columns ("BillingState","Name") -Values ($_.BillingState, $_.Name) -Where ("Id = `'"+$_.Id+"`'")
}else{
Add-Certinia -Connection $certinia -Table Account -Columns ("BillingState","Name") -Values ($_.BillingState, $_.Name)
}
}
As always, our goal is to simplify the way you connect to data. With cmdlets users can install a data module, set the connection properties, and start building. Download Cmdlets and start working with your data in PowerShell today!
Download a free trial of the Certinia Cmdlets to get started:
Download NowLearn more:
👁 Certinia IconAn easy-to-use set of PowerShell Cmdlets offering real-time access to Certinia. The Cmdlets allow users to easily read, write, update, and delete live data - just like working with SQL server.