After the site is restored, access denied appears

Source: Internet
Author: User

Recently I have prepared some demos for Sharepoint 2010. I found that some backup site collections (using backup-spsite or UI) are being restored to the farm in another domain, all access denied, even if I use an account with the same name or the account with the highest permissions.

Another phenomenon is that when you try to replace the site collection administrator, the error "object reference not set to an instance of an object" will occur.

 

The ULS log is analyzed and no cause is found. Today, I suddenly thought, because when I restored to another domain, even if the domain name is the same, the user's Sid has changed. So you need to synchronize the user account.

In SharePoint 2007, you can run the stsadm-O migrateuser command. Now that you have reached SharePoint 2010, use powershell. The following command is used:

$ Spfarm = [microsoft. Sharepoint. Administration. spfarm]: Local
$ Spfarm. migrateuseraccount ("contoso \ Administrator", "contoso \ Administrator", $ false)

The first parameter is the previous account, the second is the new account, and the last parameter is whether the SID history is retained. Because I am a cross-origin account, I do not need to keep it.

 

After synchronization, the problem is solved.

 

Note: If you run this command, an error may occur for the Administrator account. You can ignore it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.