I got Error message “value does not fall within the expected range” in QA. It is working fine in DEV. I had increased threshold value from 12 to 20 in QA and working fine. but client does not approved to increase same in prod.
I have also reverted lookup threshold value back to 12 and add my id in user policy again it worked. but as we could not add normal user to user policy this will not work again in prod. Then I tried to use run with elevated privileged, it worked fine now in QA but does not worked in prod. what change i need to do in code.
How can I pass app pool account. I am using below, please correct me where I am going wrong.
SPUserToken token = oWeb.AllUsers[@"domain\abc-18"].UserToken;
using (SPSite elevatedSite = new SPSite(oWeb.Site.ID, token))
{
SPWeb web = elevatedSite.OpenWeb();
I am getting user could not be found.