dsccommunity / ActiveDirectoryDsc

This module contains DSC resources for deployment and configuration of Active Directory Domain Services.
MIT License
344 stars 142 forks source link

ADReplicationSiteLink: Exception is Thrown When Creating a Site Link with any Options #571

Closed X-Guardian closed 4 years ago

X-Guardian commented 4 years ago

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

When creating a new Site Link, the ADReplicationSiteLink throws an exception stating that "the parameter could not be found" if any site link options have been specified.

Verbose logs showing the problem

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 test site
 link. (ADRSL0008)
VERBOSE: [DC01-2019]:                            [[ADReplicationSiteLink]DirectResourceAccess] Creating AD Site Link
test. (ADRSL0006)
A parameter cannot be found that matches parameter name 'OptionChangeNotification'.
    + CategoryInfo          : InvalidArgument: (:) [], CimException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.ActiveDirectory.Management.Commands.NewADReplicationSit
   eLink
    + PSComputerName        : localhost

VERBOSE: [DC01-2019]: LCM:  [ End    Set      ]  [[ADReplicationSiteLink]DirectResourceAccess]  in 0.0940 seconds.
The PowerShell DSC resource '[ADReplicationSiteLink]DirectResourceAccess' with SourceInfo '' threw one or more
non-terminating errors while running the Set-TargetResource functionality. These errors are logged to the ETW channel
called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.
    + CategoryInfo          : InvalidOperation: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : NonTerminatingErrorFromProvider
    + PSComputerName        : localhost

VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 0.409 seconds

Suggested solution to the issue

Add Site Link option processing to the New-ADReplicationSiteLink parameters.

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

Invoke-DscResource -Name ADReplicationSiteLink -ModuleName ActiveDirectoryDsc -Method Set -Verbose `
    -Property @{
    Name                     = 'test'
    SitesIncluded            = 'site1', 'site2'
    OptionChangeNotification = $true
    Ensure                   = 'Present'
}

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

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

5.0.0