![]() |
VOOZH | about |
The CData Cmdlets for Adobe Target are standard PowerShell cmdlets that make it easy to accomplish data cleansing, normalization, backup, and other integration tasks by enabling real-time access to Adobe Target.
The Cmdlets are not only a PowerShell interface to Adobe Target, but also an SQL interface; this tutorial shows how to use both to retrieve Adobe Target data. We also show examples of the ADO.NET equivalent, which is possible with the CData ADO.NET Provider for Adobe Target. To access Adobe Target data from other .NET applications, like LINQPad, use the CData ADO.NET Provider for Adobe Target.
Once you have acquired the necessary connection properties, accessing Adobe Target data in PowerShell can be enabled in three steps.
To connect to Adobe Target, you must provide the Tenant property along with OAuth connection properties mentioned below. Note that while other connection properties can influence processing behavior, they do not affect the ability to connect.
To determine your Tenant name:
You must set AuthScheme to OAuthClient for all user account flows.
Note: Adobe authentication via OAuth requires updating your token every two weeks.
Obtaining the OAuth Access Token
Set the following properties to connect:
With these settings, the provider obtains an access token from Adobe Target, which it uses to request data. The OAuth values are stored in the location specified by OAuthSettingsLocation, ensuring they persist across connections.
Install the module:
Install-Module AdobeTargetCmdlets
Connect:
$adobetarget = Connect-AdobeTarget -Tenant "$Tenant" -InitiateOAuth "$InitiateOAuth"
Search for and retrieve data:
$type = "AB" $activities = Select-AdobeTarget -Connection $adobetarget -Table "Activities" -Where "Type = `'$Type`'" $activities
You can also use the Invoke-AdobeTarget cmdlet to execute SQL commands:
$activities = Invoke-AdobeTarget -Connection $adobetarget -Query 'SELECT * FROM Activities WHERE Type = @Type' -Params @{'@Type'='AB'}
Load the provider's assembly:
[Reflection.Assembly]::LoadFile("C:\Program Files\CData\CData ADO.NET Provider for Adobe Target\lib\System.Data.CData.AdobeTarget.dll")
Connect to Adobe Target:
$conn= New-Object System.Data.CData.AdobeTarget.AdobeTargetConnection("Tenant=mycompanyname;InitiateOAuth=GETANDREFRESH;")
$conn.Open()
Instantiate the AdobeTargetDataAdapter, execute an SQL query, and output the results:
$sql="SELECT Id, Name from Activities"
$da= New-Object System.Data.CData.AdobeTarget.AdobeTargetDataAdapter($sql, $conn)
$dt= New-Object System.Data.DataTable
$da.Fill($dt)
$dt.Rows | foreach {
Write-Host $_.id $_.name
}
Download a free trial of the Adobe Target Data Provider to get started:
Download NowLearn more:
👁 Adobe Target IconEasily connect .NET applications with real-time data. Use Adobe Target to manage the data that powers your applications.