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: Fails to Set Options After the Resource is Initially Created #605

Closed
X-Guardian opened this issue Apr 27, 2020 · 0 comments · Fixed by #606
Closed
Assignees
Labels
bug The issue is a bug.

Comments

@X-Guardian
Copy link
Contributor

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

The ADReplicationSiteLink resource fails to set OptionChangeNotification, OptionTwoWaySync or OptionDisableCompression if they are set after the resource is initially created.

Verbose logs showing the problem

Invoke-DscResource -Name ADReplicationSitelink -Method Set -ModuleName ActiveDirectoryDsc `
     -Property @{
         Name          = 'testlink1'
         sitesincluded = @('testsite1','testsite2')
     } -Verbose
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = ResourceSet,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' =
root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer DC01-2019 with user sid S-1-5-21-3553084080-2500667019-4197401787-500.
VERBOSE: [DC01-2019]: LCM:  [ Start  Set      ]  [[ADReplicationSiteLink]DirectResourceAccess]
VERBOSE: [DC01-2019]:                            [[ADReplicationSiteLink]DirectResourceAccess] Could not find 'testlink1' site link. (ADRSL0009)
VERBOSE: [DC01-2019]:                            [[ADReplicationSiteLink]DirectResourceAccess] Creating AD Site Link 'testlink1'. (ADRSL0007)
VERBOSE: [DC01-2019]: LCM:  [ End    Set      ]  [[ADReplicationSiteLink]DirectResourceAccess]  in 0.5630 seconds.
VERBOSE: [DC01-2019]: LCM:  [ End    Set      ]    in  1.0160 seconds.
VERBOSE: Operation 'Invoke CimMethod' complete.

RebootRequired
--------------
False
VERBOSE: Time taken for configuration job to complete is 1.262 seconds
Invoke-DscResource -Name ADReplicationSitelink -Method Set -ModuleName ActiveDirectoryDsc `
     -Property @{
         Name                     = 'testlink1'
         sitesincluded            = @('testsite1','testsite2')
         OptionChangeNotification = $true
         OptionTwoWaySync         = $true
         OptionDisableCompression = $true
     } -Verbose
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = ResourceSet,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' =
root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer DC01-2019 with user sid S-1-5-21-3553084080-2500667019-4197401787-500.
VERBOSE: [DC01-2019]: LCM:  [ Start  Set      ]  [[ADReplicationSiteLink]DirectResourceAccess]
VERBOSE: [DC01-2019]:                            [[ADReplicationSiteLink]DirectResourceAccess] Setting property 'OptionChangeNotification' to 'True' on site link 'testlink1'. (ADRSL0004)
VERBOSE: [DC01-2019]:                            [[ADReplicationSiteLink]DirectResourceAccess] Setting property 'TwoWaySync' to 'True' on site link 'testlink1'. (ADRSL0004)
VERBOSE: [DC01-2019]:                            [[ADReplicationSiteLink]DirectResourceAccess] Setting property 'OptionDisableCompression' to 'True' on site link 'testlink1'. (ADRSL0004)
VERBOSE: [DC01-2019]: LCM:  [ End    Set      ]  [[ADReplicationSiteLink]DirectResourceAccess]  in 0.2040 seconds.
VERBOSE: [DC01-2019]: LCM:  [ End    Set      ]    in  0.2500 seconds.
VERBOSE: Operation 'Invoke CimMethod' complete.

RebootRequired
--------------
False
VERBOSE: Time taken for configuration job to complete is 0.402 seconds
Invoke-DscResource -Name ADReplicationSitelink -Method Test -ModuleName ActiveDirectoryDsc `
     -Property @{
         Name                     = 'testlink1'
         sitesincluded            = @('testsite1','testsite2')
         OptionChangeNotification = $true
         OptionTwoWaySync         = $true
         OptionDisableCompression = $true
     } -Verbose
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = ResourceTest,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' =
root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer DC01-2019 with user sid S-1-5-21-3553084080-2500667019-4197401787-500.
VERBOSE: [DC01-2019]: LCM:  [ Start  Test     ]  [[ADReplicationSiteLink]DirectResourceAccess]
VERBOSE: [DC01-2019]:                            [[ADReplicationSiteLink]DirectResourceAccess] 'OptionChangeNotification' is not in desired state Current: 'False' Desired: 'True'. (ADRSL0003)
VERBOSE: [DC01-2019]:                            [[ADReplicationSiteLink]DirectResourceAccess] 'OptionTwoWaySync' is not in desired state Current: 'False' Desired: 'True'. (ADRSL0003)
VERBOSE: [DC01-2019]:                            [[ADReplicationSiteLink]DirectResourceAccess] 'OptionDisableCompression' is not in desired state Current: 'False' Desired: 'True'. (ADRSL0003)
VERBOSE: [DC01-2019]: LCM:  [ End    Test     ]  [[ADReplicationSiteLink]DirectResourceAccess] False in 0.0630 seconds.
VERBOSE: [DC01-2019]: LCM:  [ End    Set      ]    in  0.1100 seconds.
VERBOSE: Operation 'Invoke CimMethod' complete.

InDesiredState
--------------
False
VERBOSE: Time taken for configuration job to complete is 0.254 seconds

Suggested solution to the issue

Adjust Set-TargetResource logic to correctly set options on a pre-existing resource.

The operating system the target node is running

OsName               : Microsoft Windows Server 2019 Datacenter
OsOperatingSystemSKU : DatacenterServerEdition
OsArchitecture       : 64-bit
WindowsVersion       : 1809
WindowsBuildLabEx    : 17763.1.amd64fre.rs5_release.180914-1434
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

Version and build of PowerShell the target node is running

Name                           Value
----                           -----
PSVersion                      5.1.17763.316
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.316
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Version of the DSC module that was used

ModuleType Version    Name 
---------- -------    ----            
Manifest   6.0.1      ActiveDirectoryDsc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug.
Projects
None yet
1 participant