Saturday, January 16, 2016

Test-SPContentDatabase: Cannot open database [Database Name] requested by the login. The login failed.

Problem: 
In a SharePoint 2013 to SharePoint 2016 migration, Got this error message on testing the content database with Test-SPContentDatabase cmdlet  to identify possible issues:
"Cannot open database [Database Name] requested by the login. The login failed"

Test-SPContentDatabase: Cannot open database [Database Name] requested by the login. The login failed.
Troubleshooting:
  • If your databases are hosted on a different SQL Server or instance, other than the default SharePoint database server as its config database: Use -ServerInstance parameter with Test-SPContentDatabase cmdlet, because SharePoint always tries to find the database on the default database Server. E.g.
    Test-SpContentDatabase -name "WSS_Content_KM_New" -webapplication http://portal.crescent.com -ServerInstance "SQL001\SharePoint"
  • Test-SPContentDatabase is running from the context of the SharePoint Farm Administrator account. So make sure the Farm Account has enough access to the content database! Go to SQL Server >> Security >> Under Logins right click on your Farm Admin Account and select Properties. Under "User Mapping" tab >> Select your SharePoint content database >> Check the db_owner role.
  • Try running the PowerShell as an administrator.
If you get this "Cannot open database 'Database Name' requested by the login. The login failed" issue in case of orphaned databases. Follow this article to fix it: Cannot open database 'WSS_Content' Requested by the login. The login failed.



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Check out these SharePoint products:

No comments :

Post a Comment

Please Login and comment to get your questions answered!


You might also like:

Related Posts Plugin for WordPress, Blogger...