Automate Greenhouse Integration Tasks from PowerShell

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

The CData ADO.NET Provider for Greenhouse 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 Greenhouse.

ADO.NET Provider

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

Once you have acquired the necessary connection properties, accessing Greenhouse data in PowerShell can be enabled in three steps.

You need an API key to connect to Greenhouse. To create an API key, follow the steps below:

  1. Click the Configure icon in the navigation bar and locate Dev Center on the left.
  2. Select API Credential Management.
  3. Click Create New API Key.
    • Set "API Type" to Harvest.
    • Set "Partner" to custom.
    • Optionally, provide a description.
  4. Proceed to Manage permissions and select the appropriate permissions based on the resources you want to access through the driver.
  5. Copy the created key and set APIKey to that value.
  1. Load the provider's assembly:

    [Reflection.Assembly]::LoadFile("C:\Program Files\CData\CData ADO.NET Provider for Greenhouse\lib\System.Data.CData.Greenhouse.dll")
  2. Connect to Greenhouse:

    $conn= New-Object System.Data.CData.Greenhouse.GreenhouseConnection("APIKey=YourAPIKey;")
    $conn.Open()
  3. Instantiate the GreenhouseDataAdapter, execute an SQL query, and output the results:

    $sql="SELECT Id, CandidateId from Applications"
    
    $da= New-Object System.Data.CData.Greenhouse.GreenhouseDataAdapter($sql, $conn)
    $dt= New-Object System.Data.DataTable
    $da.Fill($dt)
    
    $dt.Rows | foreach {
        Write-Host $_.id $_.candidateid
    }

Ready to get started?

Download a free trial of the Greenhouse Data Provider to get started:

 Download Now

Learn more:

Greenhouse Icon Greenhouse ADO.NET Provider

Rapidly create and deploy powerful .NET applications that integrate with Greenhouse data including Applications, Candidates, Departments, Jobs, JobOpenings, Offers, and more!