Hi,
I wanted to create a site collection on a SharePoint 2013 installation from a remote application.
One possibility to create the collection is the web service _vti_adm/admin.asmx. Which is working using impersonation in the case where the authentification of the concerned website is set to NTLM (Windows).
From the moment we are adding Authentication by Federation we are getting SoapExceptions:
"User cannot be found." ErrorCode "0x80131600"
Some workaround was to use PowerShell scripts behind a secured web service, and the use of the PowerShell command "New-SPSite".
I got the idea from the MSDN documentation, where it is listed under Examples. Unfortunately these examples don’t work, because the parameter “-owner” is unknown. At least in our version of SP?
So we tried with the following commands [1]:
$web = "http://machine/sites/site1"
$user = New-SPClaimsPrincipal -IdentityType WindowsSamAccountName -Identity $(whoami)
New-SPSite -Name "site1" -Url $web -OwnerAlias $user -Template "STS#1"
This script is working correctly when I startup PowerShell “As Administrator”. But I don’t have this possibility for my Web service. When it is not started with administration rights, I get the following message:
New-SPSite : Cannot complete this action.
The Pool for the web service runs under the rights of the SharePoint admin account (not system administrator).
Anybody out there who already had the same problem or at least an idea how I could fix this?
[0] http://technet.microsoft.com/en-us/library/ff607546.aspx
[1] http://blogs.msdn.com/b/mutaz/archive/2012/05/29/new-spsite-and-new-spclaimprincipal.aspx