{"id":598,"date":"2012-06-07T13:38:28","date_gmt":"2012-06-07T12:38:28","guid":{"rendered":"http:\/\/blog.repsaj.nl\/?p=598"},"modified":"2012-07-09T19:04:01","modified_gmt":"2012-07-09T18:04:01","slug":"sp2010-restoring-mysite-site-administrators","status":"publish","type":"post","link":"http:\/\/blog.repsaj.nl\/index.php\/2012\/06\/sp2010-restoring-mysite-site-administrators\/","title":{"rendered":"SP2010: Restoring MySite Site Administrators"},"content":{"rendered":"<p>Today we ran into a weird problem. People reported not having access to their personal documents library on their MySite. So I checked, the Personal Documents library ACL was empty for that particular user. But for other users, I noticed where were some entried, just not their own user account and always Limited rights (which means a document or folder inside the library probably has custom rights).<\/p>\n<p>So what was happening? Well, I checked some more and\u00a0noticed that all sites had an empty Site Administrators box (Site Settings -&gt; Site Collection Administrators). Normally, the users account would be in there because you are always an administrator of your own personal MySite. Why those were cleared, I&#8217;m still not yet sure. But luckily, this is quite easily fixable with a short Powershell script. So I thought I&#8217;d share it here for anyone who might run across the same problem.<\/p>\n<pre class=\u201dprettyprint [lang-powershell|linenums:1]\u201c>\r\n$wa = Get-SPWebApplication \"https:\/\/www.sharepoint.com\"\r\n\r\nforeach ($site in $wa.Sites)\r\n{\r\n  if ($site.Url -match \"https:\/\/www.sharepoint.com\/mysite\/\") \r\n\u00a0 {\r\n    Write-Host Updating $site.Url\r\n    $user = $site.RootWeb.AllUsers[$site.Owner.UserLogin]\r\n    $user.IsSiteAdmin = $true\r\n    $user.Update()\r\n  } \r\n}\r\n<\/pre>\n<p>Since the site.Owner property still points to the correct user, this script simply takes that user; finds it in the AllUsers collection, sets the IsSiteAdmin property to true and saves the changes. Et voila; all users can acess their libraries again. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today we ran into a weird problem. People reported not having access to their personal documents library on their MySite. So I checked, the Personal Documents library ACL was empty for that particular user. But for other users, I noticed where were some entried, just not their own user account and always Limited rights (which<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[34],"tags":[7,47,23],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3KFR1-9E","_links":{"self":[{"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/posts\/598"}],"collection":[{"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/comments?post=598"}],"version-history":[{"count":0,"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/posts\/598\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/media?parent=598"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/categories?post=598"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/tags?post=598"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}