![]() |
VOOZH | about |
The CData Cmdlets for Raisers Edge NXT are standard PowerShell cmdlets that make it easy to accomplish data cleansing, normalization, backup, and other integration tasks by enabling real-time access to Raisers Edge NXT.
The Cmdlets are not only a PowerShell interface to Raisers Edge NXT, but also an SQL interface; this tutorial shows how to use both to retrieve Raisers Edge NXT data. We also show examples of the ADO.NET equivalent, which is possible with the CData ADO.NET Provider for Raisers Edge NXT. To access Raisers Edge NXT data from other .NET applications, like LINQPad, use the CData ADO.NET Provider for Raisers Edge NXT.
Once you have acquired the necessary connection properties, accessing Raisers Edge NXT data in PowerShell can be enabled in three steps.
Before establishing a connection, supply the SubscriptionKey, found in the Blackbaud Raiser's Edge NXT Profile.
Blackbaud Raiser's Edge NXT uses the OAuth authentication standard. You can connect to without setting any connection properties using the embedded OAuth credentials.
Alternatively, you can authenticate by creating a custom app to obtain the OAuthClientId, OAuthClientSecret, and CallbackURL connection properties.
See the Help documentation for an authentication guide.
Install the module:
Install-Module RaiserEdgeNXTCmdlets
Connect:
$raiseredgenxt = Connect-RaiserEdgeNXT -SubscriptionKey "$SubscriptionKey" -OAuthClientId "$OAuthClientId" -OAuthClientSecret "$OAuthClientSecret" -CallbackURL "$CallbackURL" -InitiateOAuth "$InitiateOAuth"
Search for and retrieve data:
$type = "Home" $constituents = Select-RaiserEdgeNXT -Connection $raiseredgenxt -Table "Constituents" -Where "Type = `'$Type`'" $constituents
You can also use the Invoke-RaiserEdgeNXT cmdlet to execute SQL commands:
$constituents = Invoke-RaiserEdgeNXT -Connection $raiseredgenxt -Query 'SELECT * FROM Constituents WHERE Type = @Type' -Params @{'@Type'='Home'}
Load the provider's assembly:
[Reflection.Assembly]::LoadFile("C:\Program Files\CData\CData ADO.NET Provider for Raisers Edge NXT\lib\System.Data.CData.RaiserEdgeNXT.dll")
Connect to Raisers Edge NXT:
$conn= New-Object System.Data.CData.RaiserEdgeNXT.RaiserEdgeNXTConnection("SubscriptionKey=MySubscriptionKey;OAuthClientId=MyOAuthClientId;OAuthClientSecret=MyOAuthClientSecret;CallbackURL=http://localhost:33333;InitiateOAuth=GETANDREFRESH;")
$conn.Open()
Instantiate the RaiserEdgeNXTDataAdapter, execute an SQL query, and output the results:
$sql="SELECT Id, AddressLines from Constituents"
$da= New-Object System.Data.CData.RaiserEdgeNXT.RaiserEdgeNXTDataAdapter($sql, $conn)
$dt= New-Object System.Data.DataTable
$da.Fill($dt)
$dt.Rows | foreach {
Write-Host $_.id $_.addresslines
}
Download a free trial of the Raisers Edge NXT Data Provider to get started:
Download NowLearn more:
👁 Raisers Edge NXT IconRapidly create and deploy powerful .NET applications that integrate with Raisers Edge NXT.