SPUserProfileSyncConnection: Multiple issues
See original GitHub issueDetails of the scenario you tried and the problem that is occurring
1: Modifying Included OUs and Excluded OUs fails updating the configured OUs because the returned list is a copy of the internal list of OUs. DirectoryServiceNamingContext.ContainersExcluded and DirectoryServiceNamingContext.ContainersIncluded returns a new list for each call, so any modifications of these will not be persisted in SharePoint.
2: On SharePoint 2016(2019) all tests fails
3: Updating/modifying existing sync connections fails with exception.
4: ExcludedOUs does not add to the list of excluded OUs in SP2016(2019?)
Verbose logs showing the problem
1: N/A
2: N/A
3: Fails with exception: connection exists and forest is different. use force
4: N/A
Suggested solution to the issue
1: Reflection needs to be used to modify the instance variables containersIncluded and containersExcluded for all operations (clear and add)
2a: Get method needs to replace occurrences of ‘,DC=’ with ‘.’ and remove remaining occurences of ‘DC=’ for return value Forrest
2b: Get method encapsulates the OUs in an array which will prevent test method to correctly work when there are more than one OU. This encapsulation (1, 2) needs to be removed.
3: $connection.Server is internal in SharePoint 2016 and the if statements will therefore always lead to this exception in SP2016 (2019?). This code is only used when executing in a SP2013 environment, so it should be moved into the switch statement further down so that it’s only executed on a SharePoint 2013 environemnt.
4: ExludedOUs are implemented as removal of existing IncludedOUs in the sync connection. Excluded OUs should therefore be removed from values to check in the test method and this should be pointed out in the documentation. Alternatively this needs to be implemented so that ExcludedOUs are added to the list of excluded OUs in the sync connection.
The DSC configuration that is used to reproduce the issue (as detailed as possible)
# insert configuration here
The operating system the target node is running
OsName : Microsoft Windows Server 2016 Datacenter OsOperatingSystemSKU : DatacenterServerEdition OsArchitecture : 64-bit WindowsBuildLabEx : 14393.2724.amd64fre.rs1_release.181231-1751 OsLanguage : en-US OsMuiLanguages : {en-US}#### Version of SharePoint that is used (e.g. SharePoint 2016)
Version of SharePoint that is used (e.g. SharePoint 2016)
SharePoint 2016/2013
Version and build of PowerShell the target node is running
Name Value
PSVersion 5.1.14393.2636 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} BuildVersion 10.0.14393.2636 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1
Version of the DSC module that was used (‘dev’ if using current dev branch)
3.1.0.0
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (9 by maintainers)
No, I’ve not been able to look further into this. I will try to see if I can get something done within a couple of weeks.
The issue still present in SharePoint 2013 for this closed issue: https://github.com/PowerShell/SharePointDsc/issues/439
See my last comment Do I add a new issue?