I have several composite DSC resources that make my master configurations super simple. However I just ran into a problem where a composite DSC is using the xGroup resource to add a member to local administrators. I then need to also add another user to administrators as part of the master configuration. This errors because the group name “Administrators” is the key for the xGroup resource.
Has anyone run into this scenario and how’d you get around it?
I currently see these as my options and I’m not sure which is best…
- Modify xGroup (cGroup) to support what I need by having some other key identifier
- Create new DSC resource xLocalAdministrator (based on xGroup) that allows multiple definitions
- Remove the xGroup definition from the composite resource and have to put it into my master configurations instead.
I am currently leaning towards option 2.\
Example configuration:
Configuration SoftwarePackageX { Import-DscResource -Name MSFT_xGroup xGroup Administrators { GroupName = 'Administrators' MembersToInclude = 'DOMAIN\SERVICEACCOUNT' } } Configuration SqlServer { Import-DscResource -Name MSFT_xGroup xGroup Administrators { GroupName = 'Administrators' MembersToInclude = 'DOMAIN\Database Administrators' } SoftwarePackageX {} }