You can modify SiteIdForItem’s site selection algorithm by setting one or more input parameters. By default, SiteIdForItem only returns an enabled site. If desired, you can allow return of a site that is both inactive and disabled site by setting the input parameters includeInactiveSites and includeDisabledSites to true.

Among all sites that are eligible to be returned, SiteIdForItem determines its selection by prioritizing the sites as follows: