Model Context Protocol (MCP) finally gives AI models a way to access the business data needed to make them really useful at work. CData MCP Servers have the depth and performance to make sure AI has access to all of the answers.
Try them now for free →Automate Blackbaud FE NXT Integration Tasks from PowerShell
Are you in search of a quick and easy way to access Blackbaud FE NXT data from PowerShell? This article demonstrates how to utilize the Blackbaud FE NXT Cmdlets for tasks like connecting to Blackbaud FE NXT data, automating operations, downloading data, and more.
The CData Cmdlets for Blackbaud FE NXT 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 Blackbaud FE NXT.
PowerShell Cmdlets or ADO.NET Provider?
The Cmdlets are not only a PowerShell interface to Blackbaud FE NXT, but also an SQL interface; this tutorial shows how to use both to create, retrieve, update, and delete Blackbaud FE NXT data. We also show examples of the ADO.NET equivalent, which is possible with the CData ADO.NET Provider for Blackbaud FE NXT. To access Blackbaud FE NXT data from other .NET applications, like LINQPad, use the CData ADO.NET Provider for Blackbaud FE NXT.
Once you have acquired the necessary connection properties, accessing Blackbaud FE NXT data in PowerShell can be enabled in three steps.
Blackbaud Financial Edge NXT uses the OAuth authentication standard. To authenticate using OAuth, you will need to create an app to obtain the OAuthClientId, OAuthClientSecret, and CallbackURL connection properties.
See the Getting Started guide in the CData driver documentation for more information.
PowerShell
-
Install the module:
Install-Module FinancialEdgeNXTCmdlets
-
Connect:
$financialedgenxt = Connect-FinancialEdgeNXT -SubscriptionKey "$SubscriptionKey"
-
Search for and retrieve data:
$modifiedby = "System" $accounts = Select-FinancialEdgeNXT -Connection $financialedgenxt -Table "Accounts" -Where "ModifiedBy = `'$ModifiedBy`'" $accounts
You can also use the Invoke-FinancialEdgeNXT cmdlet to execute SQL commands:
$accounts = Invoke-FinancialEdgeNXT -Connection $financialedgenxt -Query 'SELECT * FROM Accounts WHERE ModifiedBy = @ModifiedBy' -Params @{'@ModifiedBy'='System'}
ADO.NET
-
Load the provider's assembly:
[Reflection.Assembly]::LoadFile("C:\Program Files\CData\CData ADO.NET Provider for Blackbaud FE NXT\lib\System.Data.CData.FinancialEdgeNXT.dll")
-
Connect to Blackbaud FE NXT:
$conn= New-Object System.Data.CData.FinancialEdgeNXT.FinancialEdgeNXTConnection("SubscriptionKey=MySubscriptionKey;InitiateOAuth=GETANDREFRESH") $conn.Open()
-
Instantiate the FinancialEdgeNXTDataAdapter, execute an SQL query, and output the results:
$sql="SELECT AccountId, AccountNumber from Accounts" $da= New-Object System.Data.CData.FinancialEdgeNXT.FinancialEdgeNXTDataAdapter($sql, $conn) $dt= New-Object System.Data.DataTable $da.Fill($dt) $dt.Rows | foreach { Write-Host $_.accountid $_.accountnumber }
Update Blackbaud FE NXT Data
PowerShell
Update-FinancialEdgeNXT -Connection $FinancialEdgeNXT -Columns @('AccountId','AccountNumber') -Values @('MyAccountId', 'MyAccountNumber') -Table Accounts -Id "MyId"
ADO.NET
$cmd = New-Object System.Data.CData.FinancialEdgeNXT.FinancialEdgeNXTCommand("UPDATE Accounts SET ModifiedBy='System' WHERE Id = @myId", $conn)
$cmd.Parameters.Add((New-Object System.Data.CData.FinancialEdgeNXT.FinancialEdgeNXTParameter("@myId","10456255-0015501366")))
$cmd.ExecuteNonQuery()
Insert Blackbaud FE NXT Data
PowerShell
Add-FinancialEdgeNXT -Connection $FinancialEdgeNXT -Table Accounts -Columns @("AccountId", "AccountNumber") -Values @("MyAccountId", "MyAccountNumber")
ADO.NET
$cmd = New-Object System.Data.CData.FinancialEdgeNXT.FinancialEdgeNXTCommand("INSERT INTO Accounts (ModifiedBy) VALUES (@myModifiedBy)", $conn)
$cmd.Parameters.Add((New-Object System.Data.CData.FinancialEdgeNXT.FinancialEdgeNXTParameter("@myModifiedBy","System")))
$cmd.ExecuteNonQuery()
Delete Blackbaud FE NXT Data
PowerShell
Remove-FinancialEdgeNXT -Connection $FinancialEdgeNXT -Table "Accounts" -Id "MyId"
ADO.NET
$cmd = New-Object System.Data.CData.FinancialEdgeNXT.FinancialEdgeNXTCommand("DELETE FROM Accounts WHERE Id=@myId", $conn)
$cmd.Parameters.Add((New-Object System.Data.CData.FinancialEdgeNXT.FinancialEdgeNXTParameter("@myId","001d000000YBRseAAH")))
$cmd.ExecuteNonQuery()
CodeProject