![]() |
VOOZH | about |
The CData Cmdlets for SAP SuccessFactors LMS are standard PowerShell cmdlets that make it easy to accomplish data cleansing, normalization, backup, and other integration tasks by enabling real-time access to SAP SuccessFactors LMS.
The Cmdlets are not only a PowerShell interface to SAP SuccessFactors LMS, but also an SQL interface; this tutorial shows how to use both to retrieve SAP SuccessFactors LMS data. We also show examples of the ADO.NET equivalent, which is possible with the CData ADO.NET Provider for SAP SuccessFactors LMS. To access SAP SuccessFactors LMS data from other .NET applications, like LINQPad, use the CData ADO.NET Provider for SAP SuccessFactors LMS.
Once you have acquired the necessary connection properties, accessing SAP SuccessFactors LMS data in PowerShell can be enabled in three steps.
SAP SuccessFactors LMS uses OAuth authentication. Before connecting, you must configure an OAuth application tied to your SAP SuccessFactors LMS account.
To establish a connection, set the following properties:
See the Getting Started chapter of the help documentation for a guide to creating a custom OAuth app and using OAuth.
Install the module:
Install-Module SAPSuccessFactorsLMSCmdlets
Connect:
$sapsuccessfactorslms = Connect-SAPSuccessFactorsLMS -User "$User" -CompanyId "$CompanyId" -Url "$Url" -InitiateOAuth "$InitiateOAuth"
Search for and retrieve data:
$active = "true" $items = Select-SAPSuccessFactorsLMS -Connection $sapsuccessfactorslms -Table "Items" -Where "Active = `'$Active`'" $items
You can also use the Invoke-SAPSuccessFactorsLMS cmdlet to execute SQL commands:
$items = Invoke-SAPSuccessFactorsLMS -Connection $sapsuccessfactorslms -Query 'SELECT * FROM Items WHERE Active = @Active' -Params @{'@Active'='true'}
Load the provider's assembly:
[Reflection.Assembly]::LoadFile("C:\Program Files\CData\CData ADO.NET Provider for SAP SuccessFactors LMS\lib\System.Data.CData.SAPSuccessFactorsLMS.dll")
Connect to SAP SuccessFactors LMS:
$conn= New-Object System.Data.CData.SAPSuccessFactorsLMS.SAPSuccessFactorsLMSConnection("User=username;CompanyId=CompanyId;Url=https://api4.successfactors.com;InitiateOAuth=GETANDREFRESH;")
$conn.Open()
Instantiate the SAPSuccessFactorsLMSDataAdapter, execute an SQL query, and output the results:
$sql="SELECT ItemID, ItemTitle from Items"
$da= New-Object System.Data.CData.SAPSuccessFactorsLMS.SAPSuccessFactorsLMSDataAdapter($sql, $conn)
$dt= New-Object System.Data.DataTable
$da.Fill($dt)
$dt.Rows | foreach {
Write-Host $_.itemid $_.itemtitle
}
Download a free trial of the SAP SuccessFactors LMS Data Provider to get started:
Download NowLearn more:
👁 SAP SuccessFactors LMS IconRapidly create and deploy powerful .NET applications that integrate with SAP SuccessFactors LMS.