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

ADReplicationSiteLink: Verbose message does not show a current value when missing current value #519

Closed
johlju opened this issue Oct 15, 2019 · 0 comments · Fixed by #572
Labels
enhancement The issue is an enhancement request. good first issue The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub

Comments

@johlju
Copy link
Member

johlju commented Oct 15, 2019

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

If the current value is not set (empty or null) the verbose message does not show a current value when testing the configuration.

Verbose logs showing the problem

VERBOSE: [DC01]: LCM:  [ Start  Set      ]
VERBOSE: [DC01]:                            [DSCEngine] Importing the module
C:\source\ActiveDirectoryDsc\DscResources\MSFT_ADReplicationSiteLink\MSFT_ADReplicationSiteLink.psm1 in force mode.
VERBOSE: [DC01]: LCM:  [ Start  Resource ]  [[ADReplicationSiteLink]Integration_Test]
VERBOSE: [DC01]: LCM:  [ Start  Test     ]  [[ADReplicationSiteLink]Integration_Test]
VERBOSE: [DC01]:                            [[ADReplicationSiteLink]Integration_Test] Importing the module MSFT_ADReplicationSiteLink in force mode.
VERBOSE: [DC01]:                            [[ADReplicationSiteLink]Integration_Test] Site: Integration3 not found in SitesIncluded. Current SitesIncluded:
Integration2, Integration1. (ADRSL0001)
VERBOSE: [DC01]:                            [[ADReplicationSiteLink]Integration_Test] Cost is not in desired state Current:  Desired: 20. (ADRSL0003)
VERBOSE: [DC01]:                            [[ADReplicationSiteLink]Integration_Test] Description is not in desired state Current:  Desired: Integration Test Site
Link. (ADRSL0003)
VERBOSE: [DC01]:                            [[ADReplicationSiteLink]Integration_Test] ReplicationFrequencyInMinutes is not in desired state Current:  Desired: 15.
(ADRSL0003)
VERBOSE: [DC01]: LCM:  [ End    Test     ]  [[ADReplicationSiteLink]Integration_Test]  in 0.4210 seconds.
VERBOSE: [DC01]: LCM:  [ Start  Set      ]  [[ADReplicationSiteLink]Integration_Test]
VERBOSE: [DC01]:                            [[ADReplicationSiteLink]Integration_Test] Importing the module MSFT_ADReplicationSiteLink in force mode.
VERBOSE: [DC01]:                            [[ADReplicationSiteLink]Integration_Test] Adding sites Integration1, Integration3 to site link
Integration1-Integration2. (ADRSL0005)
VERBOSE: [DC01]:                            [[ADReplicationSiteLink]Integration_Test] Performing the operation "Set" on target
"CN=Integration1-Integration2,CN=IP,CN=Inter-Site Transports,CN=Sites,CN=Configuration,DC=contoso,DC=com".
VERBOSE: [DC01]: LCM:  [ End    Set      ]  [[ADReplicationSiteLink]Integration_Test]  in 1.3200 seconds.
VERBOSE: [DC01]: LCM:  [ End    Resource ]  [[ADReplicationSiteLink]Integration_Test]
VERBOSE: [DC01]: LCM:  [ End    Set      ]
VERBOSE: [DC01]: LCM:  [ End    Set      ]    in  2.5940 seconds.

Suggested solution to the issue

This could be enhanced to handle $null values to get a more descriptive verbose message.

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

The existing integration test can be used to see and resolve this issue. Snippet from the integration tests below.

<#
    .SYNOPSIS
        Creates a brand new Site Link in AD Sites and Services.
#>
Configuration MSFT_ADReplicationSiteLink_CreateSiteLink_Config
{
    Import-DscResource -ModuleName 'ActiveDirectoryDsc'

    node $AllNodes.NodeName
    {
        ADReplicationSiteLink 'Integration_Test'
        {
            Name          = 'Integration1-Integration2'
            SitesIncluded = @('Integration1', 'Integration2')
            Ensure        = 'Present'
        }
    }
}

<#
    .SYNOPSIS
        Change the attributes of a SiteLink
#>
Configuration MSFT_ADReplicationSiteLink_SetAttributes_Config
{
    Import-DscResource -ModuleName 'ActiveDirectoryDsc'

    node $AllNodes.NodeName
    {
        ADReplicationSiteLink 'Integration_Test'
        {
            Name                          = 'Integration1-Integration2'
            SitesIncluded                 = @('Integration1', 'Integration3')
            Description                   = 'Integration Test Site Link'
            Cost                          = 20
            ReplicationFrequencyInMinutes = 15
            Ensure                        = 'Present'
        }
    }
}

The operating system the target node is running

n/a

Version and build of PowerShell the target node is running

n/a

Version of the DSC module that was used ('dev' if using current dev branch)

dev

@johlju johlju added enhancement The issue is an enhancement request. good first issue The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub help wanted The issue is up for grabs for anyone in the community. labels Oct 15, 2019
@johlju johlju removed the help wanted The issue is up for grabs for anyone in the community. label Apr 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is an enhancement request. good first issue The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub
Projects
None yet
1 participant