SharePoint Troubleshooting: The file exists. (Exception from HRESULT: 0x80070050) when adding users

Applies to

SharePoint server 2010, Windows Server 2008.

Issue

When adding a user to the site we are getting error The file exists.

Error

The file exists. (Exception from HRESULT: 0x80070050)

Background

We had some users migrated from one domain to another and this is an issue with one of those users.

Site admin confirmed that user is migrated correctly and getting above error once adding user to the site.

Troubleshooting

We tried to add the user from our side and we were also getting the issue.

Tried to add the user on another side and was having the issue.

Checked in Active directory if user had valid account created.

Checked in User profile if user account entry exists.

Able to find the user in People picker and working fine.

The moment we click Ok, we get the error message.

Tried to delete the user site using PowerShell and re-added him, did not help.

Resolution

It seems to be an orphan entry of the user old account exist on the site

  • Started looking at content DB with SQL queries.
select s.Id, w.FullUrl from Sites s inner join Webs w  on
 
s.RootWebId = w.Id
 
select * from UserInfo where tp_Login='domain\username' and
 
tp_SiteID='<ID Code>'
  • Deleted user entry form UserInfo table in SP content db.
delete from  UserInfo where  tp_Login= 'domain\login'
  • Create account again using standard SP actions or just login to portal using this account. It did help to resolve the issue. 

 

Alternative approach can also be acquired to clear the user SID history.

http://blogs.technet.com/b/ashleymcglone/archive/2011/11/23/how-to-remove-sid-history-with-powershell.aspx

Credits

 http://mossnwss.blogspot.in/2014/10/the-file-exists-exception-from-hresult.html