-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPSearchServiceApp] Farm account to have db_owner permissions on all Search DBs #1311
Comments
Add logic to check if the farm account is db_owner on all Search DBs and if not, correct this. |
Sorry to return to a closed issue, but I have a few questions. I recently tried to update to version 4.7.0 of SharePointDSC in our test farm and noticed that it now gives an error on the database owner check, failing with "Error while running SQL query: The login already has an account under a different user name." I went through the changes in the pull request (https://github.com/dsccommunity/SharePointDsc/pull/1319/files) and found that the check is done with this sql query:
I tried running that on my sql server without the $User restriction and it only returns one line:
In fact sys.database_role_members only has one row that connects db_owner database role to the dbo sql user. However, if I look at Security > Logins > select the farm account > Properties > User Mapping, I can see that it has dbo for all search databases in "Users mapped to this login". It also has the db_owner role membership under "Database role membership for: ...", even though I think that's unnecessary when it's already mapped to dbo. This mapping is how SharePoint 2019 (and I think earlier versions too) created those databases when you create a new search service in Central Administration UI. Is this a difference in versions (I think we are running SQL Server 2019), or single vs. multi server farm, or just a misunderstanding? I don't think there's a way I could install SharePoint so that these could be any different, since I haven't changed them from the defaults. |
Details of the scenario you tried and the problem that is occurring
In issue #1289 @rurikon mentioned an issue that occurs when provisioning the Search Service App via PowerShell:
One thing I did notice while doing this is that setting search administrators with SPServiceAppSecurity doesn't work properly either. I have and administrator AD group and while it looks like it's added in the UI, on database level the group doesn't get access to the search databases. When I remove it and add again manually, the database rights are correct. That might explain why I kept having issues where the service pool account's rights would be dropped from one database as described in this blog: https://www.techmikael.com/2014/10/caution-if-you-have-used.html (this happened even though I started creating the service itself with the farm account so it gets the right db owner). This doesn't affect the property issue, but is worth noting if someone else is having the same kind of problems.
Verbose logs showing the problem
Suggested solution to the issue
Add logic to make sure the farm account has db_owner permissions on all Search DBs
The DSC configuration that is used to reproduce the issue (as detailed as possible)
# insert configuration here
The operating system the target node is running
Version and build of PowerShell the target node is running
Version of the DSC module that was used
dev
The text was updated successfully, but these errors were encountered: