dsccommunity/ExchangeDsc

MSFT_xExchMailboxDatabase v1.31.0 Problem on Set-TargetResource

Fabien59110 opened this issue · 4 comments

Details of the scenario you tried and the problem that is occurring

When I try to change some settings on the Exchange Database with the Resource MSFT_xExchMailboxDatabase, I have an error.

################### Error ####################
PowerShell Desired State Configuration does not support execution of commands in an interactive mode. Please ensure that the underlying command in not prompting for user input, such as missing mandatoy parameter, configuration Prompt etc.

Verbose logs showing the problem

N/A

Suggested solution to the issue

I solve this error with this change:

Line 797 to 800:

On the Set-TargetResource:

setup params

Add-ToPSBoundParametersFromHashtable -PSBoundParametersIn $PSBoundParameters -ParamsToAdd @{
'Identity' = $Name
}

Instead of:

On the Set-TargetResource:

setup params

Add-ToPSBoundParametersFromHashtable -PSBoundParametersIn $PSBoundParameters -ParamsToAdd @{
'Name' = $Name
}

The DSC configuration that is used to reproduce the issue (as detailed as possible)

$Exchange=$ConfigurationData.Exchange
#region Mailbox Database
[Boolean]$RDIUB=[System.Convert]::ToBoolean($Exchange.MailboxDatabase.RetainDeletedItemsUntilBackup)

xExchMailboxDatabase $Exchange.MailboxDatabase.Name {
Credential = $CredInstall
DatabaseCopyCount = $Exchange.MailboxDatabase.DatabaseCopyCount
EdbFilePath = $Exchange.ExchangeDatabasePath + "" + $Exchange.MailboxDatabase.Name + ".edb"
LogFolderPath = $Exchange.ExchangeLogPath + "" + $Exchange.MailboxDatabase.Name + ".log"
Name = $Exchange.MailboxDatabase.Name
Server = $ComputerName
DeletedItemRetention = New-TimeSpan -Days $Exchange.MailboxDatabase.DeletedItemRetention
MailboxRetention = New-TimeSpan -Days $Exchange.MailboxDatabase.MailboxRetention
IssueWarningQuota = $Exchange.MailboxDatabase.IssueWarningQuota
ProhibitSendQuota = $Exchange.MailboxDatabase.ProhibitSendQuota
ProhibitSendReceiveQuota = $Exchange.MailboxDatabase.ProhibitSendReceiveQuota
AllowServiceRestart = $true
RetainDeletedItemsUntilBackup = $RDIUB
}
#endregion

Exchange Server edition and version the target node is running

Exchange 2016 CU14

The operating system the target node is running

OsName : Microsoft Windows Server 2012 R2 Datacenter
OsOperatingSystemSKU : DatacenterServerEdition
OsArchitecture : 64-bit
WindowsBuildLabEx : 9600.17415.amd64fre.winblue_r4.141028-1500
OsLanguage : en-US
OsMuiLanguages : {en-US}

Version and build of PowerShell the target node is running

Powershell version: $PSVersionTable.PSVersion : 5.1.14409.1005

Version of the DSC module that was used

Name Version Path


xExchange 1.31.0 C:\Program Files\WindowsPowerShell\Modules\xExchange\1.31.0\xExchange.psd1

Hi @zazarpika , thanks for the report. Looks like this specific line of code changed in the following PR. @SSvilen , do you recall if you specifically changed this to use Name instead of Identify for a reason? If we really do need Name instead of Identity for some reason, an alternate fix for this would be to swap the order of the Add-ToPSBoundParametersFromHashtable and Remove-FromPSBoundParametersUsingHashtable calls.

#428

Hi @mhendric ,

that looks like copy-paste error or something. I've fixed that and also the integration tests. I'll open a PR as soon as the unit testing is complete.

That bug is resolved with PR #450.

Resolved in #450