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 have created a SharePoint site using stsadm.exe ( SharePoint command line administration tool ). The site has been created successfully. It can be browsed and the site administrator can log-in to the site.

Every other user which was added to site using the command below

stsadm -o adduser -url "http://test.sharepoint2013.com" -userlogin "LAB01\testuser1" -useremail "testuser@sp2013.com" -role "Full Control" -username "Test User"

the user is added successfully into SharePoint site and the Roles/Permission Levels are also successfully assigned.

But the user CANNOT login to the site. It says "Sorry, this site hasn’t been shared with you."

I have verified the user has proper permission levels assigned and can be seen in site.

There is certainly no such problem in SharePoint 2010/2007.

Please guide. I ll be thankful to you!

Regards, Rizwan

share|improve this question
1  
Why are you using stsadm for this kinds of tasks in 2013, you should use powershell at all times possible if you ask me –  Robert Lindgren Jul 17 '13 at 10:04
    
Actully thats kind of a requirement. It is working fine for all versions of SharePoint except SharePoint 2013. –  Rizwan Ahmed Jul 17 '13 at 10:27
    
My guess would be that stsadm does not handle Claims Based Authentication as good as powershell, and hence adds a user that can not login (due to a mismatch in userlogin, and actual user login, witch will have a claims token first) –  Robert Lindgren Jul 17 '13 at 10:29
    
Yea you might be right, but I have been using stsadm for SharePoint 2010 and 2007, there hasn't been a problem before. Moreover I have assigned roles through SharePoint API as well. –  Rizwan Ahmed Jul 17 '13 at 10:56
    
2010 nor 2007 had Claims as default authentication method. What do you mean with API? –  Robert Lindgren Jul 17 '13 at 10:58

3 Answers 3

up vote 1 down vote accepted

Why are you using stsadm for this kinds of tasks in 2013, you should use powershell at all times possible if you ask me.

My guess would be that stsadm does not handle Claims Based Authentication as good as powershell, and hence adds a user that can not login (due to a mismatch in userlogin, and actual user login, witch will have a claims token first)

share|improve this answer

Refer this site for "Sorry, this site hasn't been shared with you"

http://www.falconitservices.com/support/KB/Lists/Posts/Post.aspx?ID=112

http://community.spiceworks.com/topic/341758-sorry-this-site-hasn-t-been-shared-with-you

share|improve this answer
    
While this might very well be an answer we prefer it you extend your answers to more than just a link. Can you add some steps and reasoning from the links to your post? :) –  Robert Lindgren Jul 17 '13 at 10:21
    
I have gone through above links, but my problem is that I am assigning roles through admin utility (stsadm) and these roles can be seen from SharePoint site. But even after that the site shows the above mentioned error. I also tried to assign roles/permission through SharePoint API but problems still persists. –  Rizwan Ahmed Jul 17 '13 at 10:30

Its the opinion that 'stsadm' (SharePoint Admin Utility) does not handle the Claim Based Authentication well. When we create user through stsadm, it is not allowed to login to the site in SharePoint 2013. So what I did is:

Created user through SharePoint API (SharePoint.dll).

using (SPWeb web = site.OpenWeb())
{
  SPUser oUser = web.EnsureUser(UserLogin);
}

And it worked fine. You can also create user using PowerShell.

share|improve this answer

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.