Automate HCL Domino Integration Tasks from PowerShell
The CData ADO.NET Provider for HCL Domino 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 HCL Domino.
ADO.NET Provider
The ADO.NET Provider provides a SQL interface for HCL Domino; this tutorial shows how to use the Provider to retrieve HCL Domino data.
Once you have acquired the necessary connection properties, accessing HCL Domino data in PowerShell can be enabled in three steps.
Connecting to Domino
To connect to Domino data, set the following properties:
- URL: The host name or IP of the server hosting the Domino database. Include the port of the server hosting the Domino database. For example: http://sampleserver:1234/
- DatabaseScope: The name of a scope in the Domino Web UI. The driver exposes forms and views for the schema governed by the specified scope. In the Domino Admin UI, select the Scopes menu in the sidebar. Set this property to the name of an existing scope.
Authenticating with Domino
Domino supports authenticating via login credentials or an Entra ID (formerly Azure AD) OAuth application:
Login Credentials
To authenticate with login credentials, set the following properties:
- AuthScheme: Set this to "OAuthPassword"
- User: The username of the authenticating Domino user
- Password: The password associated with the authenticating Domino user
The driver uses the login credentials to automatically perform an OAuth token exchange.
EntraID (formerly AzureAD)
This authentication method uses Entra ID (formerly Azure AD) as an IdP to obtain a JWT token. You need to create a custom OAuth application in Entra ID (formerly Azure AD) and configure it as an IdP. To do so, follow the instructions in the Help documentation. Then set the following properties:
- AuthScheme: Set this to "EntraID (formerly AzureAD)"
- InitiateOAuth: Set this to GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken.
- OAuthClientId: The Client ID obtained when setting up the custom OAuth application.
- OAuthClientSecret: The Client secret obtained when setting up the custom OAuth application.
- CallbackURL: The redirect URI defined when you registered your app. For example: https://localhost:33333
- AzureTenant: The Microsoft Online tenant being used to access data. Supply either a value in the form companyname.microsoft.com or the tenant ID.
The tenant ID is the same as the directory ID shown in the Azure Portal's Entra ID (formerly Azure AD) > Properties page.
-
Load the provider's assembly:
[Reflection.Assembly]::LoadFile("C:\Program Files\CData\CData ADO.NET Provider for HCL Domino\lib\System.Data.CData.Domino.dll") -
Connect to HCL Domino:
$conn= New-Object System.Data.CData.Domino.DominoConnection("Server=https://domino.corp.com;AuthScheme=OAuthPassword;User=my_domino_user;Password=my_domino_password;") $conn.Open() -
Instantiate the DominoDataAdapter, execute an SQL query, and output the results:
$sql="SELECT Name, Address from ByName" $da= New-Object System.Data.CData.Domino.DominoDataAdapter($sql, $conn) $dt= New-Object System.Data.DataTable $da.Fill($dt) $dt.Rows | foreach { Write-Host $_.name $_.address }