0

I'm using Powershell to update DSN configuration. Example code:

$properties = @('server=databaseServer1', 'description=Test description')
Set-OdbcDsn -Name 'TestDSN' -SetPropertyValue $properties -DsnType System

This works. I want to enable SQL Server Authentication, following this page I tried:

$properties = @('SqlPassword=SQL_AU_PASSWORD')

Does not work. Also tried:

$properties = @('Authentication=SqlPassword')

Does not work. Both show the error Invalid keyword-value pairs.

What am I doing wrong?

1 Answer 1

1

you have to set Trusted_Connection (No = SQL Server Authentication, Yes = Windows Authentication)

$properties = @('server=databaseServer1', 'description=Test description','Trusted_Connection=No')
Set-OdbcDsn -Name 'TestDSN' -SetPropertyValue $properties -DsnType System
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.