Allow users from another domain to appear in SharePoint 2013 People Picker

Frank Martin 411 Reputation points
2022-12-26T10:04:25.293+00:00

SharePoint 2013 Enterprise is installed on Domain1.com and I want users from Domain2 to appear in People Picker. I believe AD level trust is already created because if I give access to "Everyone" on a page/list/library then users from Domain2 can also access it. Only problem is they are not appearing in People Picker.

I found steps in PowerShell to do it but I am not sure if I am doing it right so came here to clarify.

$wa = Get-SPWebApplication http://webAppUrl  
$adsearchobj = New-Object Microsoft.SharePoint.Administration.SPPeoplePickerSearchActiveDirectoryDomain  
$userpassword = ConvertTo-SecureString "UserPassword1" -AsPlainText -Force #Password for the user account CONTOSO\s-useraccount  
$adsearchobj.DomainName = "contoso.com"  
$adsearchobj.ShortDomainName = "CONTOSO" #Optional  
$adsearchobj.IsForest = $true #$true for Forest, $false for Domain  
$adsearchobj.LoginName = "s-useraccount"  
$adsearchobj.SetPassword($userpassword)  
  
$wa.PeoplePickerSettings.SearchActiveDirectoryDomains.Add($adsearchobj)  
$wa.Update()  

I am confused as to which user is "s-useraccount" and its password in above PowerShell. Is the user available on Domain1 or Domain2?

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
1,457 questions
SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,361 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Haoyan Xue_MSFT 5,266 Reputation points Microsoft Employee
    2022-12-27T02:28:07.37+00:00

    Hi @Frank Martin ,
    1.You need to first establish a trust relationship between the two domains. Then Configure People Picker in SharePoint 2013.
    For How to Add Trust Domains in a SharePoint Farm , please refer to: https://www.boostsolutions.com/blog/how-to-add-trust-domains-in-a-sharepoint-farm/
    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
    2.Then run the following command for each of your web applications, substituting the example URL and domains with your web application URL, local and trusted domain and/or forest.For a full forest trust:

     stsadm -o setproperty -pn peoplepicker-searchadforests -pv "forest:MY-DOMAIN.local;forest:TRUSTED-DOMAIN.local;domain:MY-DOMAIN.local;domain:TRUSTED-DOMAIN.local" -url http://my-sp-site.com.au/  
    

    I found a thread with the same need for you, please refer to:https://learn.microsoft.com/en-us/answers/questions/1106244/resolve-users-from-another-domain-in-sharepoint-20.html


    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.