Automate SAP SuccessFactors LMS Integration Tasks from PowerShell

Jerod Johnson
Jerod Johnson
Director, Technology Evangelism
Are you in search of a quick and easy way to access SAP SuccessFactors LMS data from PowerShell? This article demonstrates how to utilize the SAP SuccessFactors LMS Cmdlets for tasks like connecting to SAP SuccessFactors LMS data, automating operations, downloading data, and more.

The CData ADO.NET Provider for SAP SuccessFactors LMS is a standard ADO.NET Provider that make it easy to accomplish data cleansing, normalization, backup, and other integration tasks by enabling real-time access to SAP SuccessFactors LMS.

ADO.NET Provider

The ADO.NET Provider provides a SQL interface for SAP SuccessFactors LMS; this tutorial shows how to use the Provider to retrieve SAP SuccessFactors LMS data.

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:

  • User: Your SAP SuccessFactors LMS username.
  • CompanyId: Your SAP SuccessFactors company identifier.
  • Url: The SAP SuccessFactors API URL (e.g., https://api4.successfactors.com).
  • OAuthClientId: The client Id assigned when you registered your custom OAuth application.
  • OAuthClientSecret: The client secret assigned when you registered your custom OAuth application.

See the Getting Started chapter of the help documentation for a guide to creating a custom OAuth app and using OAuth.

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

Ready to get started?

Download a free trial of the SAP SuccessFactors LMS Data Provider to get started:

 Download Now

Learn more:

SAP SuccessFactors LMS Icon SAP SuccessFactors LMS ADO.NET Provider

Rapidly create and deploy powerful .NET applications that integrate with SAP SuccessFactors LMS data including Items, Programs, Students, EnrollmentListings, CoursesFeed, ProgramsFeed, AvailableSeat, and more!