Archive for januar 2016

Set PeoplePicker via PowerShell, multiple domains.

PowerShell is much, much easier than the old stsadm.

To see the present settings:

$wa = Get-SPWebApplication -Identity https://your.website.something
$wa.PeoplePickerSettings.SearchActiveDirectoryDomains

—–
$wa = Get-SPWebApplication -Identity https://your.website.something
$ad = New-Object Microsoft.SharePoint.Administration.SPPeoplePickerSearchActiveDirectoryDomain
$ad.DomainName = “domainA.com”
$ad.IsForest = $true
$wa.PeoplePickerSettings.SearchActiveDirectoryDomains.Add($ad)

$a1 = New-Object Microsoft.SharePoint.Administration.SPPeoplePickerSearchActiveDirectoryDomain
$a1.DomainName = “domainB.com”
$a1.IsForest = $true
$wa.PeoplePickerSettings.SearchActiveDirectoryDomains.Add($a1)

$wa.Update()