Not able to create Redshift DSN connection through the Add-OdbcDsn cmdlet

Ranjith Reddy G 1 Reputation point

Hello all,

When I'm trying to create the DSN connection for Redshift facing the below error, tried many articles, but didn't get proper help, Can you please someone help to close my issue?

Articles followed :

Below is the Query which I tried :

Add-OdbcDsn -DriverName "Amazon Redshift (x64)" -DsnType "System" -Platform "64-bit" -Name "myName" -SetPropertyValue @("", "Database=dev", "Port=5439", "Trusted_Connection=Yes", "UID=Hello", "EPWD=world" )

Add-OdbcDsn : Attempt to set the {UID or PWD} key of a DSN. These keys should not be stored in the registry for

security reason. Provide the credential information at runtime via SQLDriverConnect, SQLConnect or SQLBrowseConnect.

At line:1 char:1

  • Add-OdbcDsn -DriverName "Amazon Redshift (x64)" -DsnType "System" -Pl ...
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : InvalidArgument: (MSFT_OdbcDsnTask:Root/Microsoft/...SFT_OdbcDsnTask) [Add-OdbcDsn], Cim
    • FullyQualifiedErrorId : MI RESULT 4,Add-OdbcDsn
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
4,931 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 44,046 Reputation points

    Hello there,

    This is the source code for the function Test-ODBCConnection which tests if the ODBC connection can connect to the database.

    Function Test-ODBCConnection {
    HelpMessage="DSN name of ODBC connection")]
    $conn = new-object
    $conn.connectionstring = "(DSN=$DSN)"

    try {  
        if (($ -eq $true) {  
        else {  
    } catch {  
        Write-Host $_.Exception.Message  


    Meanwhile, this seems to be a topic that is much related to AWS services, and posting it on their support page might help you in getting this sorted.


    --If the reply is helpful, please Upvote and Accept it as an answer–

    0 comments No comments