You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: public/Copy-DbaDbMail.ps1
+41-19Lines changed: 41 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,10 @@ function Copy-DbaDbMail {
36
36
Limits migration to specific Database Mail component types instead of copying everything. Choose 'ConfigurationValues' for global settings like retry attempts and file size limits, 'Profiles' for mail profile definitions, 'Accounts' for SMTP account configurations, or 'MailServers' for SMTP server details.
37
37
Use this when you only need to sync specific components or when troubleshooting individual Database Mail layers.
38
38
39
+
.PARAMETERExcludePassword
40
+
Copies credential definitions without the actual password values.
41
+
Use this in security-conscious environments where password decryption is restricted or when passwords should be manually reset after migration.
42
+
39
43
.PARAMETERWhatIf
40
44
If this switch is enabled, no actions are performed but informational messages will be displayed that explain what would happen if the command were to run.
41
45
@@ -110,6 +114,7 @@ function Copy-DbaDbMail {
110
114
[string[]]$Type,
111
115
[PSCredential]$SourceSqlCredential,
112
116
[PSCredential]$DestinationSqlCredential,
117
+
[switch]$ExcludePassword,
113
118
[switch]$Force,
114
119
[switch]$EnableException
115
120
)
@@ -121,7 +126,7 @@ function Copy-DbaDbMail {
121
126
122
127
Write-Message-Message "Migrating mail server configuration values."-Level Verbose
Write-Message-Message "Getting mail server credentials."-Level Verbose
295
-
$sql="SELECT credentials.name AS credential_name, sysmail_server.account_id FROM sys.credentials JOIN msdb.dbo.sysmail_server ON credentials.credential_id = sysmail_server.credential_id"
Write-Message-Message "Getting mail server credentials."-Level Verbose
301
+
$sql="SELECT credentials.name AS credential_name, sysmail_server.account_id FROM sys.credentials JOIN msdb.dbo.sysmail_server ON credentials.credential_id = sysmail_server.credential_id"
0 commit comments