February 19, 2018 at 9:18 pm #94065
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?
February 19, 2018 at 9:23 pm #94068
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.
February 19, 2018 at 9:26 pm #94077
Thank you very much for the quick reply ... will give this a shot.
February 20, 2018 at 11:45 am #94168
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.
February 20, 2018 at 12:43 pm #94173
Nevermind ... will replace MSFT_xADDomainController.psm1 in "Save-Module" location, rezip, checksum and try to use it.
February 20, 2018 at 7:57 pm #94257
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\22.214.171.124\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.
February 21, 2018 at 2:18 am #94308
Can you re-package it as a 126.96.36.199? You'd also need to re-do the manifest (the psd1 in the 188.8.131.52 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 184.108.40.206. The ISE will tell you if it has a problem loading it.
February 21, 2018 at 1:17 pm #94338
Success!! Thanks Missy, that final info was exactly what I needed. DC is deploying now without DNS Server Install.
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!!
February 22, 2018 at 12:31 pm #94404
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!
You must be logged in to reply to this topic.