Ready to get started?

Download a free trial of the Raisers Edge NXT Data Provider to get started:

 Download Now

Learn more:

Raisers Edge NXT Icon Raisers Edge NXT ADO.NET Provider

Rapidly create and deploy powerful .NET applications that integrate with Raisers Edge NXT.

Automate Raisers Edge NXT Integration Tasks from PowerShell



Are you in search of a quick and easy way to access Raisers Edge NXT data from PowerShell? This article demonstrates how to utilize the Raisers Edge NXT Cmdlets for tasks like connecting to Raisers Edge NXT data, automating operations, downloading data, and more.

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.

PowerShell Cmdlets or ADO.NET Provider?

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.

Authenticating to Raiser's Edge NXT

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.

PowerShell

  1. Install the module:

    Install-Module RaiserEdgeNXTCmdlets
  2. Connect:

    $raiseredgenxt = Connect-RaiserEdgeNXT -SubscriptionKey "$SubscriptionKey" -OAuthClientId "$OAuthClientId" -OAuthClientSecret "$OAuthClientSecret" -CallbackURL "$CallbackURL"
  3. 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'}

ADO.NET

  1. 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")
  2. 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()
  3. 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 }