Sharepoint Powershell Set scope of people picker to particular domain

To scope people picker

$wa = Get-SPWebApplication “http://webapplicationurl

$adsearchobj = New-Object Microsoft.SharePoint.Administration.SPPeoplePickerSearchActiveDirectoryDomain

$adsearchobj.DomainName = “domain.com”

$wa.PeoplePickerSettings.SearchActiveDirectoryDomains.Add($adsearchobj)

$wa.Update()

To reset peoplepicker setting

$wa = Get-SPWebApplication “http://webapplicationurl”

$adsearchobj = New-Object Microsoft.SharePoint.Administration.SPPeoplePickerSearchActiveDirectoryDomain

$wa.PeoplePickerSettings.SearchActiveDirectoryDomains.clear()

$wa.Update()

Leave a Reply

Your email address will not be published. Required fields are marked *

Bitnami