SharePointDsc icon indicating copy to clipboard operation
SharePointDsc copied to clipboard

SPUserProfileSyncConnection: Multiple issues

Open jensotto opened this issue 7 years ago • 9 comments

Details 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

jensotto avatar Feb 04 '19 12:02 jensotto

PR only partially fixes this issue, reopening issue

ykuijs avatar Feb 05 '19 10:02 ykuijs

Issue number 1 has not been fixed.

jensotto avatar Feb 05 '19 10:02 jensotto

We only use reflection to get variables from SharePoint. If the Object Model doesn't publish public methods to update values, we unfortunately cannot implement that functionality.

Reason behind this, is that when using internal methods the PG can update methods without publishing these updates or we call the methods the incorrect way/order/etc resulting in an unsupported environment.

ykuijs avatar Feb 05 '19 10:02 ykuijs

I agree. An alternate approach is to delete the naming context on each update and recreate it from supplied values.

jensotto avatar Feb 05 '19 10:02 jensotto

If we use the Get method in the Set method to retrieve the current values, we can determine if the values have changed. If this is the case, we can indeed delete the naming context and recreate it.

ykuijs avatar Feb 12 '19 04:02 ykuijs

Hi @jensotto Do you have an update on this issue?

ykuijs avatar Apr 09 '19 20:04 ykuijs

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.

jensotto avatar Apr 11 '19 17:04 jensotto

Hi @jensotto Any update on this issue?

ykuijs avatar Sep 19 '19 12:09 ykuijs

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?

luigilink avatar Oct 01 '19 19:10 luigilink