Move Inbox Documents between Users

Created by Support Team, Modified on Thu, 21 Oct, 2021 at 4:26 PM by Jeremy Burgess

The below SQL query can be used to either move documents from user to another, or to update a current user in the case of a username or domain change.


Use with care!!

DECLARE @oldUser NVARCHAR(50) = 'domain\olduser';
DECLARE @newUser NVARCHAR(50) = 'domain\newuser';

-- To find affected records
SELECT * FROM userdocs
WHERE ActionResponse = -1
AND deleted <> 1
AND IdentityName LIKE '%' + @oldUser + '%'

-- Move them to the new user
BEGIN TRAN;

UPDATE userdocs SET IdentityName = @newUser
WHERE ActionResponse = -1
AND deleted <> 1
AND IdentityName LIKE '%' + @oldUser + '%'
ROLLBACK TRAN;

-- COMMIT TRAN; when doing this for real


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article