DSC - xADDomainController w/o DNS

Hi all, new to DSC, just finished training and deployed a DC…however, it has DNS Server installed/AD Integrated, etc and we do not use AD DNS (I know, please do not go there). Cannot find any parms to prevent DNS Server from installing and not confident that using WindowsFeature DNS w/Ensure=“Absent” would help (possibly make things worse). Any ideas on how I can keep DNS Server from installing during the DSC promo process?


The way that resource is presently written, you can’t. You’d need to write our own resource. If you look at the source code (https://github.com/PowerShell/xActiveDirectory/blob/dev/DSCResources/MSFT_xADDomainController/MSFT_xADDomainController.psm1), you can see it’s just using Install-ADDSDomainController under the hood, so creating a custom version shouldn’t be too tricky.

If you do it right, you’d just pass in a parameter to prevent DNS installation (since using DNS is a default). If you do, be sure to submit a pull request so the entire community can benefit from the change.

You’ll need to do -InstallDns:$False since the default will be true, since you have MS DNS installed already. Odd choice.

Thank you very much for the quick reply … will give this a shot.

Made module adjustments to fully support InstallDNS parm. When I try to import module, get error: The term ‘C:\MSFT_xADCommon\MSFT_xADCommon.ps1’ is not recognized as the name of a cmdlet, function, script file, or operable program.

Clearly from last few lines import AD common functions. $PSScriptRoot is blank, guessing there’s more packaging I need to do to test/use this module. Removed that line and tested functions, looks good.

Suggestions/Doc on how to package module? You mentioned “pull request”, guessing that means upload these changes to community…will have to check if that’s allowed. Thanks again for the help.

Nevermind … will replace MSFT_xADDomainController.psm1 in “Save-Module” location, rezip, checksum and try to use it.

So close…but not working. I’ve updated the .psm1 and .schema.mof to handle parm InstallDNS. Saved both to C:\Program Files\WindowsPowerShell\Modules\xActiveDirectory\\DSCResources\MSFT_xADDomainController\ (overwriting the original files). Added InstallDNS parm to the resource config…when running script to generate .mof, get error below.

PSDesiredStateConfiguration\Node : The term ‘xADDomainController’ is not recognized as the name of a cmdlet, function, script file, or operable program.

Any ideas?

Can you re-package it as a You’d also need to re-do the manifest (the psd1 in the folder) using new-modulemanifest and the -moduleversion parameter.

Also, when you import it in import-DSCResources in your config, are you specifying the module version specifically using -RequiredVersion? If not, use it and point to The ISE will tell you if it has a problem loading it.

Success!! Thanks Missy, that final info was exactly what I needed. DC is deploying now without DNS Server Install.

Additional Options:
Read-only domain controller: “No”
Global catalog: Yes
DNS Server: No

Problems encountered along the way:
– Old DSC Resource (of new version), could not remove it after seeing error…had to revert to VM snapshot.
– PSGetModuleInfo.xml in new version, had to update GUID and adjust version throughout (3-4 places I think)

If someone can share the best way I should upload/share this new version, I’d be happy to as long as I can get approval.

Great forum, I’ll be back…thank you!!

That’s awesome! I believe this resource is part of the DSC resource kit and is subject to HQRM guidelines, so I would start here for instructions on contributing back… and congrats on getting it working!