Programmatically Add the Site Collections to Have Read Only
Programmatically Add the Site Collections to Have Read Only Access to the Local Site Collection Taxonomy Group in SharePoint 2013 using JAVASCRIPT
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Rajkiran SwainPosted Apr 29, 2015, 7:27 AM
a difference?) Adding the same group to the Site Collection Administrators in Central Admindoes not work, however.
The trick to doing this programaticallyis to remember to use the claims id (c:0.w|sid)instead of the domain\username version if your collection is using claims. Example:
$s = get-spsite http://site;
$u = $s.RootWeb.EnsureUser(c:0.w|s-1-5-21-3470830999-3355434441-3654256088-34400);
$u.IsSiteAdmin = $true;
$u.Update();
Vijay SPosted Apr 28, 2015, 9:48 AM
Am not sure about it. If u got any solution for it. Please share it with us.