dsccommunity / ConfigMgrCBDsc

This module contains DSC resources for the management and configuration of Microsoft System Center Configuration Manager Current Branch (ConfigMgrCB).
MIT License
27 stars 8 forks source link

CMDistributionPointGroupMembership #63

Closed jeffotterpohl closed 4 years ago

jeffotterpohl commented 4 years ago

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

Created a configuration where you are creating a Distribution Point and right after creating the distribution Point you try assigning a DistributionPointGroupMember to the distribution Point it will error. If you follow up and run the resource again everything will be successful. There is a check in the DistributionPointGroupMember to see if the server is a distribution point, but Config Mgr. sees the DP role is installed so it will not throw an error and will try to add the Distro point to the distro point group.

Verbose logs showing the problem

PowerShell DSC resource DSC_CMDistributionPointGroupMembers failed to execute Set-TargetResource functionality with error message: No object corresponds to the specified parameters.

Suggested solution to the issue

adding a try catch loop to try add the DP to the group with a sleep between trys. This will allow for DP to become fully provisioned and be able to be added to the Group.

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

Configuration PrimaryInstallDPStandard
{

    Import-DscResource -ModuleName ConfigMgrCBDsc

    Node localhost
    {
        CMDistributionPoint DP01.contoso.com
        {
            SiteCode            = 'Lab'
            SiteServerName = 'DP01.contoso.com'
            Description        = 'Standard DP'
        }

        CMDistributionPointGroupMembers DP01.contoso.com
        {
            SiteCode                                 = 'Lab'
            DistributionPoint                    = 'DP01.contoso.com'
            DistributionGroupsToInclude = 'DPGroup1'
            DependsOn                            = '[CMDistributionPoint]DP01.contoso.com'
        }
    }
}

The operating system the target node is running

Version and build of PowerShell the target node is running

Version of the DSC module that was used

0.2.0

jeffotterpohl commented 4 years ago

bug fix as has been resolved. added code to check up to 2 minutes for the distribution point to be provisioned when trying to add a distribution point to a distribution point group.