Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am using SP2013 single server dev environment. I use following scripts for creating web application and site collection. but when I browse to it, it says this site has not been shared with you. I am Administrator and logged on as Administrator and cleaned all cache services.

$appPoolAccount = "dev\sp_service"
New-SPWebApplication -ApplicationPool $appPool -ApplicationPoolAccount $appPoolAccount -Name $name -DatabaseName $dataBaseName -Url $url -Port $port -HostHeader $hostHeader -AuthenticationMethod "NTLM"

$domainAnduser = "dev\Administrator"
New-SPSite -Url $url -OwnerAlias $domainAnduser -Name $name -Template $template -Language 1033

It works if I do all above via CA.

share|improve this question
add comment

1 Answer

If your web application is in Claims mode (uses Claims based authentication, CBA), you need to grant permission for username that is in claims format, like i:0#.w|dev\administrator. More info here.

share|improve this answer
    
Thank you, why it works when you create the web app and sc from CA? –  Medes Mar 21 '13 at 11:13
    
Because when your doing it from CA you resolve the inputted login names (sharepoint maps your input to an existing ad user) –  Robert Lindgren Mar 21 '13 at 12:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.