Question

i am able to remove the user from site collection using in this way:-

SPWeb.SiteUsers.Remove("providername:" + this.txtOldName.Text);

but found the same user existing in All People how to remove user from All People programmatically

Was it helpful?

Solution

i fixed the issue using

oldUser = oWeb.SiteUsers["providername:" + this.txtOldName.Text];
int id = oldUser.ID;
oWeb.SiteUsers.RemoveByID(id);

oWeb is the object of SPWeb

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top