{"id":438,"date":"2012-05-16T11:02:40","date_gmt":"2012-05-16T11:02:40","guid":{"rendered":"http:\/\/www.myfatblog.co.uk\/?p=438"},"modified":"2012-05-16T11:14:56","modified_gmt":"2012-05-16T11:14:56","slug":"shell-access-to-sharepoint","status":"publish","type":"post","link":"http:\/\/www.myfatblog.co.uk\/index.php\/2012\/05\/shell-access-to-sharepoint\/","title":{"rendered":"Shell access to SharePoint."},"content":{"rendered":"<p>One of the things that has always annoyed me in SharePoint 2010 is the security in PowerShell when trying to work with SharePoint objects.<\/p>\n<p>There I am, logged into my freshly created development box, drop into PowerShell and can\u00e2\u20ac\u2122t access anything, despite running as administrator. The missing ingredients, yes Database permissions, so duly into SQL, give my log on account DBO access (Come on, it\u00e2\u20ac\u2122s a development box! grin..)<\/p>\n<p>A better way though is to use the PowerShell cmdlet Add-SPShellAdmin against each of the content databases that I want to work with. (It\u00e2\u20ac\u2122s my Dev box, so all of them frankly..)<\/p>\n<p><a title=\"http:\/\/technet.microsoft.com\/en-us\/library\/ff607596.aspx\" href=\"http:\/\/technet.microsoft.com\/en-us\/library\/ff607596.aspx\">http:\/\/technet.microsoft.com\/en-us\/library\/ff607596.aspx<\/a>&#160;<\/p>\n<p>This command, coupled with a quick PowerShell script to loop through the SPContentDatabase collection soon ensures unrestricted access!<\/p>\n<pre class=\"csharpcode\">Get-SPContentDatabase | ForEach-Object {<\/pre>\n<pre class=\"csharpcode\">Add-SPShellAdmin -username <span class=\"str\">&quot;domain\\paul&quot;<\/span> -database $_<\/pre>\n<pre class=\"csharpcode\">}<\/pre>\n<style type=\"text\/css\">\n.csharpcode, .csharpcode pre\n{\n\tfont-size: small;\n\tcolor: black;\n\tfont-family: consolas, \"Courier New\", courier, monospace;\n\tbackground-color: #ffffff;\n\t\/*white-space: pre;*\/\n}\n.csharpcode pre { margin: 0em; }\n.csharpcode .rem { color: #008000; }\n.csharpcode .kwrd { color: #0000ff; }\n.csharpcode .str { color: #006080; }\n.csharpcode .op { color: #0000c0; }\n.csharpcode .preproc { color: #cc6633; }\n.csharpcode .asp { background-color: #ffff00; }\n.csharpcode .html { color: #800000; }\n.csharpcode .attr { color: #ff0000; }\n.csharpcode .alt \n{\n\tbackground-color: #f4f4f4;\n\twidth: 100%;\n\tmargin: 0em;\n}\n.csharpcode .lnum { color: #606060; }<\/style>\n<p>I wish I\u00e2\u20ac\u2122d come across this cmdlet much earlier while working with SP2010 but I never really did get straight into PowerShell until the last 10 months or so.<\/p>\n<p>Paul.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the things that has always annoyed me in SharePoint 2010 is the security in PowerShell when trying to work with SharePoint objects. There I am, logged into my freshly created development box, drop into PowerShell and can\u00e2\u20ac\u2122t access anything, despite running as administrator. The missing ingredients, yes Database permissions, so duly into SQL, &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/www.myfatblog.co.uk\/index.php\/2012\/05\/shell-access-to-sharepoint\/\">Continue reading<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[7,31,6,28],"tags":[62,56,164],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Shell access to SharePoint. - Blog of an overweight SharePoint addict<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.myfatblog.co.uk\/index.php\/2012\/05\/shell-access-to-sharepoint\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Shell access to SharePoint. - Blog of an overweight SharePoint addict\" \/>\n<meta property=\"og:description\" content=\"One of the things that has always annoyed me in SharePoint 2010 is the security in PowerShell when trying to work with SharePoint objects. There I am, logged into my freshly created development box, drop into PowerShell and can\u00e2\u20ac\u2122t access anything, despite running as administrator. The missing ingredients, yes Database permissions, so duly into SQL, &hellip; Continue reading\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.myfatblog.co.uk\/index.php\/2012\/05\/shell-access-to-sharepoint\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog of an overweight SharePoint addict\" \/>\n<meta property=\"article:published_time\" content=\"2012-05-16T11:02:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2012-05-16T11:14:56+00:00\" \/>\n<meta name=\"author\" content=\"Cimares\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@cimares\" \/>\n<meta name=\"twitter:site\" content=\"@cimares\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Cimares\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.myfatblog.co.uk\/index.php\/2012\/05\/shell-access-to-sharepoint\/\",\"url\":\"http:\/\/www.myfatblog.co.uk\/index.php\/2012\/05\/shell-access-to-sharepoint\/\",\"name\":\"Shell access to SharePoint. - Blog of an overweight SharePoint addict\",\"isPartOf\":{\"@id\":\"http:\/\/www.myfatblog.co.uk\/#website\"},\"datePublished\":\"2012-05-16T11:02:40+00:00\",\"dateModified\":\"2012-05-16T11:14:56+00:00\",\"author\":{\"@id\":\"http:\/\/www.myfatblog.co.uk\/#\/schema\/person\/55ae8f6885bb5b8390dad001f3da83c6\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.myfatblog.co.uk\/index.php\/2012\/05\/shell-access-to-sharepoint\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/www.myfatblog.co.uk\/#website\",\"url\":\"http:\/\/www.myfatblog.co.uk\/\",\"name\":\"Blog of an overweight SharePoint addict\",\"description\":\"The rantings of a (not so) food obsessed IT consultant!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/www.myfatblog.co.uk\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"http:\/\/www.myfatblog.co.uk\/#\/schema\/person\/55ae8f6885bb5b8390dad001f3da83c6\",\"name\":\"Cimares\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/www.myfatblog.co.uk\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/About_D057\/TopOfTheWorld.jpg\",\"contentUrl\":\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/About_D057\/TopOfTheWorld.jpg\",\"caption\":\"Cimares\"},\"sameAs\":[\"http:\/\/www.myfatblog.co.uk\"],\"url\":\"http:\/\/www.myfatblog.co.uk\/index.php\/author\/reginald\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Shell access to SharePoint. - Blog of an overweight SharePoint addict","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/www.myfatblog.co.uk\/index.php\/2012\/05\/shell-access-to-sharepoint\/","og_locale":"en_US","og_type":"article","og_title":"Shell access to SharePoint. - Blog of an overweight SharePoint addict","og_description":"One of the things that has always annoyed me in SharePoint 2010 is the security in PowerShell when trying to work with SharePoint objects. There I am, logged into my freshly created development box, drop into PowerShell and can\u00e2\u20ac\u2122t access anything, despite running as administrator. The missing ingredients, yes Database permissions, so duly into SQL, &hellip; Continue reading","og_url":"http:\/\/www.myfatblog.co.uk\/index.php\/2012\/05\/shell-access-to-sharepoint\/","og_site_name":"Blog of an overweight SharePoint addict","article_published_time":"2012-05-16T11:02:40+00:00","article_modified_time":"2012-05-16T11:14:56+00:00","author":"Cimares","twitter_card":"summary_large_image","twitter_creator":"@cimares","twitter_site":"@cimares","twitter_misc":{"Written by":"Cimares","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"http:\/\/www.myfatblog.co.uk\/index.php\/2012\/05\/shell-access-to-sharepoint\/","url":"http:\/\/www.myfatblog.co.uk\/index.php\/2012\/05\/shell-access-to-sharepoint\/","name":"Shell access to SharePoint. - Blog of an overweight SharePoint addict","isPartOf":{"@id":"http:\/\/www.myfatblog.co.uk\/#website"},"datePublished":"2012-05-16T11:02:40+00:00","dateModified":"2012-05-16T11:14:56+00:00","author":{"@id":"http:\/\/www.myfatblog.co.uk\/#\/schema\/person\/55ae8f6885bb5b8390dad001f3da83c6"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.myfatblog.co.uk\/index.php\/2012\/05\/shell-access-to-sharepoint\/"]}]},{"@type":"WebSite","@id":"http:\/\/www.myfatblog.co.uk\/#website","url":"http:\/\/www.myfatblog.co.uk\/","name":"Blog of an overweight SharePoint addict","description":"The rantings of a (not so) food obsessed IT consultant!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.myfatblog.co.uk\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"http:\/\/www.myfatblog.co.uk\/#\/schema\/person\/55ae8f6885bb5b8390dad001f3da83c6","name":"Cimares","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/www.myfatblog.co.uk\/#\/schema\/person\/image\/","url":"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/About_D057\/TopOfTheWorld.jpg","contentUrl":"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/About_D057\/TopOfTheWorld.jpg","caption":"Cimares"},"sameAs":["http:\/\/www.myfatblog.co.uk"],"url":"http:\/\/www.myfatblog.co.uk\/index.php\/author\/reginald\/"}]}},"_links":{"self":[{"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/438"}],"collection":[{"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=438"}],"version-history":[{"count":4,"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/438\/revisions"}],"predecessor-version":[{"id":442,"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/438\/revisions\/442"}],"wp:attachment":[{"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/categories?post=438"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/tags?post=438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}