Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xExchAcceptedDomain: Errors while adding accepted domains #476

Open
ranabanerjee15 opened this issue Oct 22, 2021 · 8 comments
Open

xExchAcceptedDomain: Errors while adding accepted domains #476

ranabanerjee15 opened this issue Oct 22, 2021 · 8 comments
Labels
needs more information The issue needs more information from the author or the community.

Comments

@ranabanerjee15
Copy link

Problem description

Hello Team,

First, I want to say, wonderful module. this has helped me a lot to automate deployments of Exchange 2019. now coming to the issue, I get the following error while deploying Exchange 2019 Accepted domain resources.

Verbose logs

Status Message: VM has reported a failure when processing extension 'ExchangeSetup2019'. Error message: "DSC Configuration 'SetupEx19' completed with error(s). Following are the first few: t" to type "Systet32". Error:Cannot convert value "MakeDefaul "Input string was not in a correct format." Exception calling "Remove" with "1" argument(s): "Collection was of a fixed size." The PowerShell DSC resource '[xExchAcceptedDomain]AccDomLab01' with SourceInfo 'C:\Packages\Plugins\Microsoft.Powershell.DSC\2.83.2.0\DSCWork\SetupEx19.0\SetupEx19.ps1::372::9::xExchAcceptedDomain' threw one or more non-terminating errors while running the Test-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details."

DSC configuration

xExchAcceptedDomain AccDomLab01 #ResourceName
        {
            Name               = "Lab01.online"
            Credential         = $ExCreds
            DomainName         = "Lab01.online"
            AddressBookEnabled = $true
            DomainType         = "Authoritative"
            Ensure             = 'Present'
            MakeDefault        = $true
            DependsOn          = "[xPendingReboot]AfterExchangeInstall"

        }
        xExchAcceptedDomain AccDomDomain02 #ResourceName
        {
            Name               = 'Domain02.online'
            Credential         = $ExCreds
            DomainName         = 'Domain02.online'
            AddressBookEnabled = $true
            DomainType         = 'Authoritative'
            Ensure             = 'Present'
            MakeDefault        = $False
            DependsOn          = "[xExchAcceptedDomain]AccDomLab01"
        }

Suggested solution

none yet

Operating system the target node is running

windows Server 2019

Exchange Server edition and version the target node is running

Exchange 2019

PowerShell version and build the target node is running

5.1

xExchange version

Latest Release
@johlju
Copy link
Member

johlju commented Oct 24, 2021

Could you possible debug the Test-TargetResource to find what row actually throws the error? Also interesting what value(s) the variables have on the particular line.

There are no integrations test for that resource, so would be great if this can be reproduced so we can create an integration tests for it.

@johlju johlju added bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community. labels Oct 24, 2021
@mhincapie
Copy link
Contributor

@ranabanerjee15 out of curiosity are you using the latest release? the preview ones? https://github.com/dsccommunity/xExchange/blob/main/CHANGELOG.md#changed, and has it worked before with other releases or is this the first time you are using it?

@ranabanerjee15
Copy link
Author

I think I am using the regular version (not the preview). These test servers are getting deployed in azure using bicep and dsc. I know this has worked well with ex 2016 but with 2019 it gives random unpredictable errors for anything that gets deployed post exchange install.

Like accepted domain, or virtual directories. If I redeploy it most of the time will be successful (for resources deployed post exchange install) I also found that changing time zone to anything else than utc (via dsc) causes login errors with ecp. This is due to some cert errors and the fix is to renew cert for oauth. But if I change time zone manually post installation after once logging into ecp, then works OK.

Some really strange behaviours, I will try using the preview and see if it helps in any way. Never the less. I am able to still deploy exchange 2019 via dsc, which is GREAT

@mhincapie
Copy link
Contributor

That is excellent, @ranabanerjee15 . Let us know if it works. We use Chef to deploy and configure Exchange Servers with this DSC Module. It works great with Exchange 2019. Also, we configure virtual directories, and there is no problem. So there might be something outside of this module that might be the issue. I hope that helps!

@johlju johlju added needs investigation The issue needs to be investigated by the maintainers or/and the community. and removed bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community. labels Oct 26, 2021
@ranabanerjee15
Copy link
Author

@mhincapie Thanks for the update, can you please share one of your sample DSC configurations for Exchange 2019, I would love to compare it with mine. would be interested to see the dependencies and hierarchy of the specific configurations applied.

@johlju johlju added needs more information The issue needs more information from the author or the community. and removed needs investigation The issue needs to be investigated by the maintainers or/and the community. labels Oct 31, 2021
@johlju johlju changed the title Errors while adding accepted domains xExchAcceptedDomain: Errors while adding accepted domains Oct 31, 2021
@johlju
Copy link
Member

johlju commented Oct 31, 2021

I have released a new version of xExchange, using that version (1.33.0) please provide more information to determine if and where there is an issue.

@ranabanerjee15
Copy link
Author

@johlju I will try with the latest version today / tomorrow and get back to you.

@mhincapie
Copy link
Contributor

mhincapie commented Nov 3, 2021

@ranabanerjee15 Chef is a bit different on how you apply DSC, because all the process is somewhat automated, and it's very versatile so that we can use multiple DSC modules.

We first install all prerequisites that are provided in the following link: https://docs.microsoft.com/en-us/exchange/plan-and-deploy/prerequisites?view=exchserver-2019

We make sure that we include the xExchange DSC Module in the prerequisites and other modules that we use and finally reboot the machine for the next step.

powershell_package 'install_multiple_packages' do
  action :install
  package_name %w(xExchange ComputerManagementDsc xWebAdministration)
  version ['1.33.0', '8.4.0', '3.2.0']
end

Then we install Exchange:

dsc_resource 'install_exchange' do
  resource :xExchInstall   # xExchange DSC Resource
  property :Path, 'C:\path-where-you-download-iso\Setup.exe'
  property :Arguments, '/mode:Install /role:Mailbox /IAcceptExchangeServerLicenseTerms_DiagnosticDataOFF'
  property :Credential, ps_credential(username, password)
  timeout 7200
  not_if { exchange_installed }
  notifies :reboot_now, 'reboot[reboot_server]', :immediately
end

And we configure after reboot with the xExchange DSC resources, for example the ECP virtual directory:

# Configures ecp virtual directory
dsc_resource 'configures_ecp_vir' do
  resource :xExchEcpVirtualDirectory  # xExchange DSC Resource
  property :Identity, "#{node['hostname']}\\ecp (Default Web Site)"
  property :Credential, ps_credential(username, password)
  property :AdfsAuthentication, true
  property :BasicAuthentication, false
  property :DigestAuthentication, false
  property :FormsAuthentication, false
  property :WindowsAuthentication, false
  property :InternalUrl, 'https://mail.domain.com/ecp'
  property :ExternalUrl, 'https://mail.domain.com/ecp'
end

Hopefully, I didn't confuse you much, but please let me know if you need more information.

ref: https://docs.chef.io/resources/dsc_resource/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more information The issue needs more information from the author or the community.
Projects
None yet
Development

No branches or pull requests

3 participants