Workflow task is assigned to DomainB\User instead of DomainA\User

Frank Martin 476 Reputation points
2024-07-17T07:12:22.7966667+00:00

I am writing this on mobile in the hope that it is published and I don't receive that stupid CAPTCHA where it asked me 15 questions to find two identical objects. I tried 3 times (total 45 questions) but failed.

I have a SharePoint 2010 style SPD workflow running in SharePoint 2016. This site was originally running on SharePoint which was on DomainA. Later it was migrated to SharePoint which is on DomainB.

Two-way trust is enabled between both domains. Users are still logging in from DomainA but SharePoint is running from DomainB. All users account are active in both domains.

The PeoplePicker on this web application is set to only get users from DomainA by using Microsoft.SharePoint.Administration.SPPeoplePickerSearchActiveDirectoryDomain.

The issues I am facing is following:

Workflow is running on a list called "My List".

This list contains a field whose name is Line Manager and type is SharePoint User

When workflow runs, task is assigned to user who is defined in Line Manager field

Problem is even if I have added user DomainA\User in Line Manager, it will still assign task to DomainB\User. This doesn't happen for all users but most of them randomly.

This creates problem because when user tries to complete task, he/she received error that you cannot perform this action as task is not assigned to you

Even if I use Move-SPUser to move that user from DomainB\User to DomainA\User, after a day or two that user will automatically come again and then workflow will start assigning it task

Even if I remove that DomainB\User from site collection then a day or two later, that user comes back again

Even though PeoplePicker is only set to show users from DomainA, it still shows users from DomainB. Sometime it shows same user from both domains and sometime only from DomainB.

Even if workflow assigns task to DomainA\User, there is no guarantee that 3 days later it won't assign task to DomainB\User

User Profile Service is running and getting data from DomainA only.

I decided to give site collection administrator rights to Everyone but it has same issue. This should have fixed the issue, right? Because now it doesn't matter who the user is, everyone is site collection administrator so they should be able to complete task but NO. If task is assigned to DomainB\User then user from DomainA\User cannot complete task even though Everyone is site collection administrator.

This is creating major problems. Why workflow keeps assigning task to DomainB\User and why those users keep coming back to site collection even if I have deleted them? And why people picker is showing users from DomainB? By the way same issue is also happening on another simple Team Site where there is no workflow running but yet somehow user from DomainA which was working previously has been changed to DomainB and now people picker is not even showing that user from DomainA.

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,370 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,810 questions
SharePoint Workflow
SharePoint Workflow
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Workflow: An orchestrated and repeatable pattern of business activity, enabling data transformation, service provision, and information retrieval.
599 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 36,171 Reputation points Microsoft Vendor
    2024-07-17T09:22:44.0033333+00:00

    Hi @Frank Martin,

    This is a complex issue involving multiple aspects of SharePoint's user management, workflows, and domain trusts. Here's a systematic approach to addressing your problem:

    1. Review People Picker Settings

    Ensure that the People Picker is configured correctly. Since you've already set it to only fetch users from DomainA, verify that this setting is applied across all site collections:

    $webApp = Get-SPWebApplication "http://your-webapp-url"
    $webApp.PeoplePickerSettings.SearchActiveDirectoryDomains
    
    
    
    1. Clear User Caches

    Sometimes, SharePoint caches user information, which could be causing issues. Clear the user information list cache:

    $webApp = Get-SPWebApplication "http://your-webapp-url"
    $webApp.Properties.Remove("vti_userid")
    $webApp.Update()
    
    1. Check Group Memberships

    Sometimes, users may be added to SharePoint groups from DomainB, causing conflicts. Regularly check and clean up groups:

    $site = Get-SPSite "http://your-site-url"
    $groups = $site.RootWeb.SiteGroups
    foreach ($group in $groups) {
        $users = $group.Users
        foreach ($user in $users) {
            if ($user.LoginName -like "DomainB\*") {
                Write-Host "Removing $($user.LoginName) from $($group.Name)"
                $group.RemoveUser($user)
            }
        }
    }
    $site.Dispose()
    
    1. Check Logs

    Look through the SharePoint ULS logs and Windows Event logs for any errors or warnings related to user synchronization, workflow assignments, or AD interactions.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.