After adding users to a SQL database in SharePoint, and then performing dismount and mount operations, the users' db_owner permission is removed.
This situation occurs when the following steps are taken:
- Add two users to the content database with db_owner and SPDataAccess permissions.
- Detach the database using Dismount-SPContentDatabase.
- Run Mount-SPContentDatabase.
The two users are present in the SQL database, but the db_owner permission has been removed.
SharePoint currently strips all members of ContentDB's DBO role (except for the user running the upgrade) as part of an improved security model.
To run the scenario and retain the db_owner permission, you must first modify the registry:
- Locate and then select the following registry subkey:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\16.0\WSS\
- Select Edit, then New, and then select DWORD Value.
- Enter BypassDboDropMember, and then select the Enter key.
- In the Details pane, select and hold (or right-click) BypassDboDropMember, and then select Modify.
- In the Value data box, enter 1, and then select OK.
By default the value is 0 if the registry is not present.
- Exit the Registry Editor.