@@ -59,7 +59,7 @@ Import-Module "SqlServer"
59
59
$serverName = "<server name>"
60
60
$databaseName = "<database name>"
61
61
# Change the authentication method in the connection string, if needed.
62
- $connStr = "Server = " + $serverName + "; Database = " + $databaseName + "; Integrated Security = True"
62
+ $connStr = "Server = " + $serverName + "; Database = " + $databaseName + "; Integrated Security = True; TrustServerCertificate = True "
63
63
$database = Get-SqlDatabase -ConnectionString $connStr
64
64
65
65
# Create a SqlColumnMasterKeySettings object for your new column master key.
@@ -150,7 +150,7 @@ Import-Module "SqlServer"
150
150
$serverName = "<server name>"
151
151
$databaseName = "<database name>"
152
152
# Change the authentication method in the connection string, if needed.
153
- $connStr = "Server = " + $serverName + "; Database = " + $databaseName + "; Integrated Security = True"
153
+ $connStr = "Server = " + $serverName + "; Database = " + $databaseName + "; Integrated Security = True; TrustServerCertificate = True "
154
154
$database = Get-SqlDatabase -ConnectionString $connStr
155
155
156
156
# Retrieve the data about the old column master key, which needs to be rotated.
@@ -243,7 +243,7 @@ Import-Module "SqlServer"
243
243
$serverName = "<server name>"
244
244
$databaseName = "<database name>"
245
245
# Change the authentication method in the connection string, if needed.
246
- $connStr = "Server = " + $serverName + "; Database = " + $databaseName + "; Integrated Security = True"
246
+ $connStr = "Server = " + $serverName + "; Database = " + $databaseName + "; Integrated Security = True; TrustServerCertificate = True "
247
247
$database = Get-SqlDatabase -ConnectionString $connStr
248
248
249
249
# Create a SqlColumnMasterKeySettings object for your new column master key.
@@ -310,7 +310,7 @@ Import-Module "SqlServer"
310
310
$serverName = "<server name>"
311
311
$databaseName = "<database name>"
312
312
# Change the authentication method in the connection string, if needed.
313
- $connStr = "Server = " + $serverName + "; Database = " + $databaseName + "; Integrated Security = True"
313
+ $connStr = "Server = " + $serverName + "; Database = " + $databaseName + "; Integrated Security = True; TrustServerCertificate = True "
314
314
$database = Get-SqlDatabase -ConnectionString $connStr
315
315
316
316
# Generate a new column encryption key, encrypt it with the column master key and create column encryption key metadata in the database.
0 commit comments