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
WARNING: [22:44:11][New-DbaDbMailProfile] Failure | Violation of UNIQUE KEY constraint
'SYSMAIL_PROFILE_NameMustBeUnique'. Cannot insert duplicate key in object 'dbo.sysmail_profile'. The duplicate key
value is (INGAA LLR Website Email Sender Profile).
The statement has been terminated.
Upon executing the second command, where the account name and priority has changed, a unique key constraint violation is issued. It seems that there is an attempt to recreate the entire profile versus checking if the profile already exists and then appending an account to the existing profile. It appears that creating the profile and adding an account to the profile are already two separate steps, but the fact that this is a one to many relationship is not accounted for.
Please confirm that you are running the most recent version of dbatools
2.1.3
Other details or mentions
Profiles can have multiple accounts, each is given a priority. The New-DbaDbMailProfile module configures priority, but it seems it only allows adding one account.
What PowerShell host was used when producing this error
Microsoft SQL Server 2019 (RTM) - 15.0.2000.5 (X64) Sep 24 2019 13:48:23 Copyright (C) 2019 Microsoft Corporation Developer Edition (64-bit) on Windows Server 2019 Datacenter 10.0 (Build 17763: ) (Hypervisor)
.NET Framework Version
PSChildName Version
Client 4.8.03761
Full 4.8.03761
Client 4.0.0.0
The text was updated successfully, but these errors were encountered:
Verified issue does not already exist?
I have searched and found no existing issue
What error did you receive?
WARNING: [22:44:11][New-DbaDbMailProfile] Failure | Violation of UNIQUE KEY constraint
'SYSMAIL_PROFILE_NameMustBeUnique'. Cannot insert duplicate key in object 'dbo.sysmail_profile'. The duplicate key
value is (INGAA LLR Website Email Sender Profile).
The statement has been terminated.
Steps to Reproduce
Upon executing the second command, where the account name and priority has changed, a unique key constraint violation is issued. It seems that there is an attempt to recreate the entire profile versus checking if the profile already exists and then appending an account to the existing profile. It appears that creating the profile and adding an account to the profile are already two separate steps, but the fact that this is a one to many relationship is not accounted for.
Please confirm that you are running the most recent version of dbatools
2.1.3
Other details or mentions
Profiles can have multiple accounts, each is given a priority. The New-DbaDbMailProfile module configures priority, but it seems it only allows adding one account.
What PowerShell host was used when producing this error
Windows PowerShell (powershell.exe)
PowerShell Host Version
Name Value
PSVersion 5.1.17763.3770
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.3770
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
SQL Server Edition and Build number
Microsoft SQL Server 2019 (RTM) - 15.0.2000.5 (X64) Sep 24 2019 13:48:23 Copyright (C) 2019 Microsoft Corporation Developer Edition (64-bit) on Windows Server 2019 Datacenter 10.0 (Build 17763: ) (Hypervisor)
.NET Framework Version
PSChildName Version
Client 4.8.03761
Full 4.8.03761
Client 4.0.0.0
The text was updated successfully, but these errors were encountered: