Automate Claude Compliance Integration Tasks from PowerShell
The CData ADO.NET Provider for Claude Compliance 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 Claude Compliance.
ADO.NET Provider
The ADO.NET Provider provides a SQL interface for Claude Compliance; this tutorial shows how to use the Provider to retrieve Claude Compliance data.
Once you have acquired the necessary connection properties, accessing Claude Compliance data in PowerShell can be enabled in three steps.
The driver connects to Claude Compliance using a Compliance Access Key, the only supported authentication method. Set the following connection property:
- APIKey: The Compliance Access Key you created.
Creating a Compliance Access Key
- Enable the Compliance API for your organization.
- Sign in to claude.ai as a primary owner or organization owner and open Organization settings > API > Keys.
- Select Create Key and assign only the scopes your integration needs:
- read:compliance_activities for Activities and the typed activity views.
- read:compliance_org_data for organizations, roles, groups, and settings.
- read:compliance_user_data for users, chats, files, projects, and downloads.
- delete:compliance_user_data for the explicit Delete stored procedures.
- Create the key and copy it when it appears. The key starts with sk-ant-api01- and is shown only once.
Optionally, set OrganizationUUID to limit organization-scoped views (such as OrganizationUsers and ComplianceRoles) to a single linked organization. If it is left empty, those views default to the first available organization and do not include data from all linked organizations.
-
Load the provider's assembly:
[Reflection.Assembly]::LoadFile("C:\Program Files\CData\CData ADO.NET Provider for Claude Compliance\lib\System.Data.CData.ClaudeCompliance.dll") -
Connect to Claude Compliance:
$conn= New-Object System.Data.CData.ClaudeCompliance.ClaudeComplianceConnection("APIKey=your_compliance_access_key;") $conn.Open() -
Instantiate the ClaudeComplianceDataAdapter, execute an SQL query, and output the results:
$sql="SELECT Id, Name from Projects" $da= New-Object System.Data.CData.ClaudeCompliance.ClaudeComplianceDataAdapter($sql, $conn) $dt= New-Object System.Data.DataTable $da.Fill($dt) $dt.Rows | foreach { Write-Host $_.id $_.name }