{"id":79555,"date":"2016-07-27T00:01:19","date_gmt":"2016-07-27T07:01:19","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/?p=79555"},"modified":"2019-02-18T09:10:30","modified_gmt":"2019-02-18T16:10:30","slug":"manage-your-sharepoint-online-tenant-with-powershell","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/manage-your-sharepoint-online-tenant-with-powershell\/","title":{"rendered":"Manage your SharePoint Online tenant with PowerShell"},"content":{"rendered":"<p><strong>Summary<\/strong>: Learn how to manage your SharePoint Online tenant installation by using Windows PowerShell cmdlets.<\/p>\n<p>Christopher Weaver is a Microsoft Premier Field Engineer (PFE) who focuses on SharePoint and Office 365 solutions for large enterprise Premier customers. He has been doing PowerShell and SharePoint with Microsoft for nine years. In his spare time, he enjoys backpacking, hiking, kite surfing, and spending time with his kids and dog. You can follow him on his blog at <a href=\"https:\/\/blogs.technet.microsoft.com\/christwe\/\">https:\/\/blogs.technet.microsoft.com\/christwe\/<\/a>.<\/p>\n<p>Hello All,<\/p>\n<p>Continuing with the topic of how to use PowerShell to migrate a site collection from your on-premises farm to Office 365, I\u2019m going to write today about how to manage your tenant.<\/p>\n<p>In my previous article, <a href=\"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2016\/07\/15\/get-started-with-powershell-and-sharepoint-online\/\"><em>Get Started with PowerShell and SharePoint Online<\/em><\/a><em>, <\/em>I walked you through how to connect to SharePoint Online. Now that you have imported the correct module and connected to your service, we can start to really have fun.<\/p>\n<p>When I talk about managing your tenant, I mean specifically your SharePoint tenant, which holds your site collections and other SharePoint objects. You will be managing organizational settings at this level. To manage the tenant, you need to be a Global Administrator. There are several cmdlets that we will look at today:<\/p>\n<p><strong>Get-SPOTenant<\/strong>: Returns many organizational properties like quota, and SiteCreationMode. You could say it\u2019s a way to get to know your tenant. Incidentally, all properties are read only when you use this cmdlet.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/HSG-7-27-16-1.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/HSG-7-27-16-1.png\" alt=\"Screenshot of result from running Get-SPOTenant.\" width=\"536\" height=\"511\" class=\"alignnone size-full wp-image-79556\" \/><\/a><\/p>\n<p><strong>Set-SPOTenant<\/strong>: Sets different organizational settings like external sharing settings and max\/min site compatibility level. This cmdlet has no required parameters, all parameters are named, and the cmdlet does not accept bind for any parameters.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/HSG-7-27-16-2.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/HSG-7-27-16-2.png\" alt=\"Screenshot of results from running Set-SPOTenant -SharingCapability ExternalUserSharingOnly.\" width=\"551\" height=\"47\" class=\"alignnone size-full wp-image-79565\" \/><\/a><\/p>\n<p><strong>Get-SPOTenantLogEntry<\/strong>: Retrieves unified logging system (ULS) style logs for all actions by external systems. You can filter on date, Correlation ID, or max number of rows.<\/p>\n<p><strong>Get-SPOTenantLogLastAvailableTimeInUtc<\/strong>: Provides date of last log in UTC. The name says it all. This cmdlet exists to help you use <strong>Get-SPOTenantLogEntry<\/strong>.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/HSG-7-27-16-3.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/HSG-7-27-16-3.png\" alt=\"Screenshot of results from running Get-SPOTenantLogLastAvailableTimeInUtc.\" width=\"481\" height=\"57\" class=\"alignnone size-full wp-image-79575\" \/><\/a><\/p>\n<p><strong>Get-SPOTenantSyncClientRestriction<\/strong>: Enumerates the options for synching between OneDrive for Business client and the app.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/HSG-7-27-16-4.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/HSG-7-27-16-4.png\" alt=\"Screenshot of results from running Get-SPOTenantSyncClientRestriction.\" width=\"440\" height=\"130\" class=\"alignnone size-full wp-image-79585\" \/><\/a><\/p>\n<p><strong>Set-SPOTenantSyncClientRestriction<\/strong>: Sets how OneDrive for Business client syncs. You can set a safe list based on domain, block Mac from synching, and block old sync client versions from connecting<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/HSG-7-27-16-5.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/HSG-7-27-16-5.png\" alt=\"Screenshot of results from running Set-SPOTenantSyncClientRestriction -GrooveBlockOption HardOptIn.\" width=\"579\" height=\"118\" class=\"alignnone size-full wp-image-79615\" \/><\/a><\/p>\n<p style=\"padding-left: 30px\"><strong>Note<\/strong>: Changes will take anywhere from one hour to 24 hours to be reflected in your tenant.<\/p>\n<p><strong>Remove-SPOTenantSyncClientRestriction<\/strong>: Sets restrictions back to false. However, it does not clear the value for <strong>AllowedDomainList<\/strong>.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/HSG-7-27-16-6.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/HSG-7-27-16-6.png\" alt=\"Screenshot with results from running Remove-SPOTenantSyncClientRestriction.\" width=\"454\" height=\"133\" class=\"alignnone size-full wp-image-79625\" \/><\/a><\/p>\n<p style=\"padding-left: 30px\"><strong>Note<\/strong>: Change will take up to 24 hours to be reflected in your tenant.<\/p>\n<p>The <strong>Set-SPOTenant<\/strong> cmdlet is the one that most people will use because you can use it to set a ton of interesting settings like <strong>BccExternalSharingInvitations<\/strong>\/<strong>BccExternalSharingInvitationsList<\/strong>, <strong>ExternalServicesEnabled<\/strong>, or <strong>SharingCapability<\/strong> to name only a few.<\/p>\n<p>Because the purpose of this blog post is to prepare us to migrate our on-premises site collections to the cloud, we should focus on those properties that will affect a migration. And, for our purposes, we will look at site creation properties.<\/p>\n<p><strong>MaxCompatibilityLevel<\/strong>\/<strong>MinCompatibilityLevel<\/strong>: These properties set the upper and lower compatibility levels for new sites. When you set this, you will have to wait up to 24 hours to see the change on your sites.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/HSG-7-27-16-7.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/HSG-7-27-16-7.png\" alt=\"Screenshot of Set-SPOTenant -MinCompatibilityLevel 14 -MaxCompatibilityLevel 15 command.\" width=\"605\" height=\"31\" class=\"alignnone size-full wp-image-79635\" \/><\/a><\/p>\n<p><strong>DisplayStartASiteOption\/StartASiteFormUrl<\/strong>: These properties control whether users can create new sites for themselves and the form that they use to create those sites. This can be a great time saver but you have to monitor the sprawl of sites. Users might create sites, determine that they are not happy with them, and abandon them to create another. By default, we do not enable the <strong>StartASite<\/strong>\u00a0option.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/HSG-7-27-16-8.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/HSG-7-27-16-8.png\" alt=\"Screenshot that shows restriction on creating new sites.\" width=\"574\" height=\"453\" class=\"alignnone size-full wp-image-79645\" \/><\/a><\/p>\n<p><strong>ShowAllUsersClaim<\/strong>\/<strong>ShowEveryoneClaim<\/strong>\/<strong>ShowEveryoneExceptExternalUsersClaim<\/strong>: You set these properties to True or False This will determine whether you can find the corresponding claim in the People Picker. If you want to hide everyone in a group in People Picker, run the following command:<\/p>\n<p style=\"padding-left: 30px\"><code>Set-SPOTenant -ShowEveryoneClaim $False<\/code><\/p>\n<p><strong>UsePersistentCookiesForExplorerView<\/strong>: To be able to use Explorer view to manage files and folders in a library, the client has to be using a persistent cookie. If you set this property, a user who uses Explorer view to connect to a machine that\u2019s private will be prompted and then will download the appropriate cookie.<\/p>\n<p>In the next article, we will look at the cmdlets that you use in the SPO module to create, delete, and configure site collections as we prepare for our migration.<\/p>\n<p>I invite you to follow me on <a href=\"http:\/\/bit.ly\/scriptingguystwitter\">Twitter<\/a> and <a href=\"http:\/\/bit.ly\/scriptingguysfacebook\">Facebook<\/a>. If you have any questions, send email to me at <a href=\"mailto:scripter@microsoft.com\">scripter@microsoft.com<\/a>, or post your questions on the <a href=\"http:\/\/bit.ly\/scriptingforum\">Official Scripting Guys Forum<\/a>. Also check out my <a href=\"https:\/\/blogs.technet.microsoft.com\/msoms\/\">Microsoft Operations Management Suite Blog<\/a>. See you tomorrow. Until then, peace.<\/p>\n<p><strong>Ed Wilson<\/strong>, Microsoft Scripting Guy<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Learn how to manage your SharePoint Online tenant installation by using Windows PowerShell cmdlets. Christopher Weaver is a Microsoft Premier Field Engineer (PFE) who focuses on SharePoint and Office 365 solutions for large enterprise Premier customers. He has been doing PowerShell and SharePoint with Microsoft for nine years. In his spare time, he enjoys [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[568,641],"tags":[694,56,3,595,45],"class_list":["post-79555","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hey-scripting-guy","category-windows-powershell","tag-christopher-weaver","tag-guest-blogger","tag-scripting-guy","tag-sharepoint-online","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Learn how to manage your SharePoint Online tenant installation by using Windows PowerShell cmdlets. Christopher Weaver is a Microsoft Premier Field Engineer (PFE) who focuses on SharePoint and Office 365 solutions for large enterprise Premier customers. He has been doing PowerShell and SharePoint with Microsoft for nine years. In his spare time, he enjoys [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/79555","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=79555"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/79555\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=79555"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=79555"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=79555"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}