Skip to content

Commit c784b85

Browse files
Merge pull request #33569 from Pietervanhove/patch-9
Update rotate-always-encrypted-keys-using-powershell.md
2 parents 95d396e + 0d96e98 commit c784b85

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/relational-databases/security/encryption/rotate-always-encrypted-keys-using-powershell.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Import-Module "SqlServer"
5959
$serverName = "<server name>"
6060
$databaseName = "<database name>"
6161
# 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"
6363
$database = Get-SqlDatabase -ConnectionString $connStr
6464
6565
# Create a SqlColumnMasterKeySettings object for your new column master key.
@@ -150,7 +150,7 @@ Import-Module "SqlServer"
150150
$serverName = "<server name>"
151151
$databaseName = "<database name>"
152152
# 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"
154154
$database = Get-SqlDatabase -ConnectionString $connStr
155155
156156
# Retrieve the data about the old column master key, which needs to be rotated.
@@ -243,7 +243,7 @@ Import-Module "SqlServer"
243243
$serverName = "<server name>"
244244
$databaseName = "<database name>"
245245
# 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"
247247
$database = Get-SqlDatabase -ConnectionString $connStr
248248
249249
# Create a SqlColumnMasterKeySettings object for your new column master key.
@@ -310,7 +310,7 @@ Import-Module "SqlServer"
310310
$serverName = "<server name>"
311311
$databaseName = "<database name>"
312312
# 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"
314314
$database = Get-SqlDatabase -ConnectionString $connStr
315315
316316
# 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

Comments
 (0)