вівторок, 23 січня 2018 р.

New-SPSite Error 0x8007007b

I was trying to create a new site collection in a new content database. This can be accomplished using PS cmdlets like this:
$server = "Database Server Name"
$dbname = "Database Name"
$webapp = "https://myapp.com/"
$site = "https://myapp.com/sites/newsite"
$owner1 = "mydomain\siteowner"
New-SPContentDatabase -Name $dbname -DatabaseServer $server -WebApplication $webapp
New-SPSite -URL $site -OwnerAlias $owner1 -ContentDatabase $dbname
First, I created a new database. Then a new site collection. As I didn't use -Template parameter with New-SPSite cmdlet I had to choose a template when I first opened "https://myapp.com/sites/newsite" site. I chose "Project Site" and after template selection I got error message "File not found...". Using correlation id I was trying to determine what was missing, among all logs I found only few lines that was interesting:
Unknown SPRequest error occurred. More information: 0x80070002
0x80070002
...
Unknown SPRequest error occurred. More information: 0x8007007b
0x8007007b
Which didn't help much. Then I tried to call New-SPSite passing -Template parameter and got similar error message:
New-SPSite : 0x8007007b
At line:3 char:1
+ New-SPSite -URL $site -OwnerAlias $owner1 -ContentDatabase "Database Name" -Templa ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (Microsoft.Share...SPCmdletNewSite:SPCmdletNewSite) [New-SPSite], SPException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewSite
So I started looking for this particular error
New-SPSite : 0x8007007b
Fortunately I found this blog https://www.communardo.de/techblog/sharepoint-2013-april-cu-und-warum-sie-es-installieren-sollten/ It's in German which I don't understand but it pointed me to simple solution that helped - just use New-SPSite with -Name parameter! So, if you are using old enough version of SP, ours is 15.0.4569.1000, and having this error, try to pass -Name parameter to New-SPSite cmdlet:
New-SPSite -URL $site -OwnerAlias $owner1 -ContentDatabase $dbname -Name "New Site Name"