Pipe DocuSign Data to CSV in PowerShell

Ready to get started?

Download a free trial of the DocuSign Cmdlets to get started:

 Download Now

Learn more:

DocuSign Icon DocuSign Cmdlets

An easy-to-use set of PowerShell Cmdlets offering real-time access to DocuSign data. The Cmdlets allow users to easily query live data - just like working with SQL server.

Use standard PowerShell cmdlets to access DocuSign tables.

The CData Cmdlets Module for DocuSign is a standard PowerShell module offering straightforward integration with DocuSign. Below, you will find examples of using our DocuSign Cmdlets with native PowerShell cmdlets.

Creating a Connection to Your DocuSign Data

To connect to DocuSign, set the following connection properties:

  • UseSandbox: indicates whether current user account is sandbox or not (FALSE by default)
  • AccountId (optional): set it in the connection string if you have access to multiple Account Ids

Authenticating to DocuSign

DocuSign 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 Help documentation more information.

$conn = Connect-DocuSign  -OAuthClientId "$OAuthClientId" -OAuthClientSecret "$OAuthClientSecret" -CallbackURL "$CallbackURL"

Selecting Data

Follow the steps below to retrieve data from the Documents table and pipe the result into to a CSV file:

Select-DocuSign -Connection $conn -Table Documents | Select -Property * -ExcludeProperty Connection,Table,Columns | Export-Csv -Path c:\myDocumentsData.csv -NoTypeInformation

You will notice that we piped the results from Select-DocuSign into a Select-Object cmdlet and excluded some properties before piping them into an Export-Csv cmdlet. We do this because the CData Cmdlets append Connection, Table, and Columns information onto each "row" in the result set, and we do not necessarily want that information in our CSV file.

The Connection, Table, and Columns are appended to the results in order to facilitate piping results from one of the CData Cmdlets directly into another one.