SharePoint 2013 People Picker for different forest

In environment where SharePoint is in AD forest and the users are in another trusted forest, the people picker will not work directly and will not pick the users from the other forest until we do the following:

  1. Log to the SharePoint server as admin

  2. Run this command

    ststsadm -o setapppassword -password <NewPassword>
    
  3. Then for each web application that you need the people picker pick users from other trusted forests

stsadm -o setproperty -url <Web_App_URL> -pn peoplepicker-searchadforests -pv "domain:<domain1FQDN>,<account_domain_1>\user,<password>; domain:< domain2FQDN >,<account_domain_2>\user,<password>"