Reputation: 975
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?
Upvotes: 0
Views: 2343
Reputation: 314
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
Upvotes: 1