<#====================================================================
Copyright © 2016, June. Michael Pomfret
Configure People Picker for cross-forest or cross-domain queries when you use a one-way trust
You should replace the “xxxxxx” with the correct passwords for the user.
Check and amend correct AD domain .
https://technet.microsoft.com/en-us/library/gg602075.aspx?f=255&MSPPError=-2147217396
====================================================================#>
Set-ExecutionPolicy -ExecutionPolicy “Unrestricted” -Force
Add-PSSnapin “Microsoft.SharePoint.PowerShell”
stsadm -o setapppassword -password xxxxxxx
STSADM -o setproperty -pn peoplepicker-searchadforests -pv “domain:yourdomain.com,AD\pBI_SP_Profile,8Pgk59sKH;forest:ad.domain.com,AD\xxx_SP_Profile,xxxxxxxxx” -url http://SharePoint_Site
STSADM -o setproperty -pn peoplepicker-searchadforests -pv “domain:yourdomain.com,AD\pBI_SP_Profile,8Pgk59sKH;forest:ad.domain.com,AD\xxx_SP_Profile,xxxxxxxxx” -url http://central_admin:port