diff --git a/Content Types/Content Types Management Setting/Allow content type management for all lists in a site/description.md b/Content Types/Content Types Management Setting/Allow content type management for all lists in a site/description.md
index a0d6f92d..fdc22124 100644
--- a/Content Types/Content Types Management Setting/Allow content type management for all lists in a site/description.md
+++ b/Content Types/Content Types Management Setting/Allow content type management for all lists in a site/description.md
@@ -22,9 +22,9 @@ $Url="https://trialtrial123.sharepoint.com/sites/teamsitewithlists"
$ContentTypesEnabled=$true
```
-###Please share your thoughts in the Q&A section!
+### Please share your thoughts in the Q&A section!
-####Related scripts
+#### Related scripts
[Set direction of the reading order for a single list](https://gallery.technet.microsoft.com/office/Set-SPOList-properties-9d16f2ba)
[Set-SPOList properties (module)](https://gallery.technet.microsoft.com/scriptcenter/Disable-or-enable-12cf3795)
diff --git a/Content Types/Content Types Management Setting/Allow content type management for all lists in site collection/ContentTypeManagementSubsitesIncluded.ps1 b/Content Types/Content Types Management Setting/Allow content type management for all lists in site collection/ContentTypeManagementSubsitesIncluded.ps1
index 9e762df4..71ad751b 100644
--- a/Content Types/Content Types Management Setting/Allow content type management for all lists in site collection/ContentTypeManagementSubsitesIncluded.ps1
+++ b/Content Types/Content Types Management Setting/Allow content type management for all lists in site collection/ContentTypeManagementSubsitesIncluded.ps1
@@ -3,61 +3,52 @@
# Created by Arleta Wanat, 2015
#
-function Set-SPOListsContentTypesEnabled
-{
-param (
- [Parameter(Mandatory=$true,Position=1)]
+function Set-SPOListsContentTypesEnabled{
+ param (
+ [Parameter(Mandatory=$true,Position=1)]
[string]$Username,
[Parameter(Mandatory=$true,Position=2)]
[string]$AdminPassword,
- [Parameter(Mandatory=$true,Position=3)]
+ [Parameter(Mandatory=$true,Position=3)]
[string]$Url,
- [Parameter(Mandatory=$true,Position=4)]
+ [Parameter(Mandatory=$true,Position=4)]
[bool]$ContentTypesEnabled
-)
-
-$password = ConvertTo-SecureString -string $AdminPassword -AsPlainText -Force
- $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url)
- $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password)
- $ctx.ExecuteQuery()
-
-$Lists=$ctx.Web.Lists
- $ctx.Load($ctx.Web)
- $ctx.Load($ctx.Web.Webs)
-$ctx.Load($Lists)
-$ctx.ExecuteQuery()
-
-Foreach($ll in $Lists)
-{
- $ll.ContentTypesEnabled = $ContentTypesEnabled
- $ll.Update()
-
-
- try
- {
- $ctx.ExecuteQuery()
- Write-Host $ll.Title " Done" -ForegroundColor Green
- }
-
- catch [Net.WebException]
- {
-
- Write-Host "Failed" $_.Exception.ToString() -ForegroundColor Red
- }
+ )
+
+ $password = ConvertTo-SecureString -string $AdminPassword -AsPlainText -Force
+ $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url)
+ $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password)
+ $ctx.ExecuteQuery()
+
+ $Lists=$ctx.Web.Lists
+ $ctx.Load($ctx.Web)
+ $ctx.Load($ctx.Web.Webs)
+ $ctx.Load($Lists)
+ $ctx.ExecuteQuery()
+
+ Foreach($ll in $Lists){
+ $ll.ContentTypesEnabled = $ContentTypesEnabled
+ $ll.Update()
+
+ try{
+ $ctx.ExecuteQuery()
+ Write-Host $ll.Title " Done" -ForegroundColor Green
+ }
+ catch [Net.WebException]{
+ Write-Host "Failed" $_.Exception.ToString() -ForegroundColor Red
+ }
+ }
+
+ if($ctx.Web.Webs.Count -gt 0){
+ Write-Host "--"-ForegroundColor DarkGreen
+
+ for($i=0;$i -lt $ctx.Web.Webs.Count ;$i++){
+ Set-SPOListsContentTypesEnabled -Username $Username -Url $ctx.Web.Webs[$i].Url -AdminPassword $AdminPassword -ContentTypesEnabled $ContentTypesEnabled
+ }
+ }
}
-if($ctx.Web.Webs.Count -gt 0)
- {
- Write-Host "--"-ForegroundColor DarkGreen
- for($i=0;$i -lt $ctx.Web.Webs.Count ;$i++)
- {
- Set-SPOListsContentTypesEnabled -Username $Username -Url $ctx.Web.Webs[$i].Url -AdminPassword $AdminPassword -ContentTypesEnabled $ContentTypesEnabled
- }
- }
-
-}
-
@@ -80,4 +71,4 @@ $ContentTypesEnabled=$true
-Set-SPOListsContentTypesEnabled -Username $Username -AdminPassword $AdminPassword -Url $Url -ContentTypesEnabled $ContentTypesEnabled
\ No newline at end of file
+Set-SPOListsContentTypesEnabled -Username $Username -AdminPassword $AdminPassword -Url $Url -ContentTypesEnabled $ContentTypesEnabled
diff --git a/Content Types/Content Types Management Setting/Allow content type management for all lists in site collection/description.md b/Content Types/Content Types Management Setting/Allow content type management for all lists in site collection/description.md
index bc34af8c..eec2be23 100644
--- a/Content Types/Content Types Management Setting/Allow content type management for all lists in site collection/description.md
+++ b/Content Types/Content Types Management Setting/Allow content type management for all lists in site collection/description.md
@@ -1,29 +1,17 @@
A short Powershell script to allow management of content types for all SharePoint Online lists and libraries across all sites in a site collection
-
-
-It is an equivalent of List>>List Settings>>Advanced>>Content types in Graphic User Interface (see screenshot)
-
-
-
-
-
-
+It is an equivalent of **List**>>**List Settings**>>**Advanced**>>**Content types in Graphic User Interface** ([see screenshot](https://github.com/PowershellScripts/AllGalleryScriptsSamples/blob/develop/Content%20Types/Content%20Types%20Management%20Setting/Allow%20content%20type%20management%20for%20all%20lists%20in%20site%20collection/contentTypeManagement.png))
Applies to lists and libraries.
-
-
-It requires installed SharePoint Online SDK
+*It requires installed* [SharePoint Online SDK](www.microsoft.com/en-us/download/details.aspx?id=42038)
You have to enter the list information before running the script:
-
-
```PowerShell
# Paths to SDK. Please verify location on your computer.
@@ -36,33 +24,26 @@ $AdminPassword="Pass"
$Url="https://trialtrial123.sharepoint.com/sites/teamsitewithlists"
$ContentTypesEnabled=$true
```
-
-
-
-
-
-Please share your thoughts in the Q&A section!
-
-
+### Please share your thoughts in the Q&A section!
-Wiki article with detailed code description:
+#### Wiki article with detailed code description:
[SharePoint Online: Turn on support for multiple content types in a list or library using Powershell](http://social.technet.microsoft.com/wiki/contents/articles/30038.sharepoint-online-turn-on-support-for-multiple-content-types-in-a-list-or-library-using-powershell.aspx)
-Related scripts
-Set-SPOList properties (module)
+#### Related scripts
+[Set-SPOList properties (module)](https://gallery.technet.microsoft.com/office/Set-SPOList-properties-9d16f2ba)
-Disable or enable attachments to list items using Powershell
+[Disable or enable attachments to list items using Powershell](https://gallery.technet.microsoft.com/scriptcenter/Disable-or-enable-12cf3795)
-Change search setting for all lists in a site using CSOM and Powershell
+[Change search setting for all lists in a site using CSOM and Powershell](https://gallery.technet.microsoft.com/scriptcenter/Change-search-setting-for-8e842a48)
-Allow content type management for all lists in a site using Powershell
+[Allow content type management for all lists in a site using Powershell](https://gallery.technet.microsoft.com/scriptcenter/Allow-content-type-5bca5157)
-Set content type management setting for SharePoint Online list using Powershell
+[Set content type management setting for SharePoint Online list using Powershell](https://gallery.technet.microsoft.com/scriptcenter/Set-content-type-39ae4bce)
diff --git a/Content Types/Content Types Management Setting/Set content type management setting for a single list/ListContentTypes.ps1 b/Content Types/Content Types Management Setting/Set content type management setting for a single list/ListContentTypes.ps1
index db6603cf..a18ba4af 100644
--- a/Content Types/Content Types Management Setting/Set content type management setting for a single list/ListContentTypes.ps1
+++ b/Content Types/Content Types Management Setting/Set content type management setting for a single list/ListContentTypes.ps1
@@ -3,58 +3,45 @@
# Created by Arleta Wanat, 2015
#
-function Set-SPOList
-{
-param (
- [Parameter(Mandatory=$true,Position=0)]
+function Set-SPOList{
+ param(
+ [Parameter(Mandatory=$true,Position=0)]
[string]$ListName,
- [Parameter(Mandatory=$true,Position=1)]
+ [Parameter(Mandatory=$true,Position=1)]
[bool]$ContentTypesEnabled
- )
+ )
-$ll=$ctx.Web.Lists.GetByTitle($ListName)
+ $ll=$ctx.Web.Lists.GetByTitle($ListName)
-$ll.ContentTypesEnabled = $ContentTypesEnabled
- $ll.Update()
-
- try
- {
- $ctx.ExecuteQuery()
- Write-Host "Done" -ForegroundColor Green
- }
-
- catch [Net.WebException]
- {
-
- Write-Host "Failed" $_.Exception.ToString() -ForegroundColor Red
- }
-
+ $ll.ContentTypesEnabled = $ContentTypesEnabled
+ $ll.Update()
+ try{
+ $ctx.ExecuteQuery()
+ Write-Host "Done" -ForegroundColor Green
+ }
+ catch [Net.WebException]{
+ Write-Host "Failed" $_.Exception.ToString() -ForegroundColor Red
+ }
}
-
-
-
-function Connect-SPOCSOM
-{
- param (
- [Parameter(Mandatory=$true,Position=1)]
+function Connect-SPOCSOM{
+ param(
+ [Parameter(Mandatory=$true,Position=1)]
[string]$Username,
[Parameter(Mandatory=$true,Position=2)]
[string]$AdminPassword,
- [Parameter(Mandatory=$true,Position=2)]
+ [Parameter(Mandatory=$true,Position=2)]
[string]$Url
-)
+ )
-
-$password = ConvertTo-SecureString -string $AdminPassword -AsPlainText -Force
- $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url)
- $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password)
- $ctx.ExecuteQuery()
-$global:ctx=$ctx
+ $password = ConvertTo-SecureString -string $AdminPassword -AsPlainText -Force
+ $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url)
+ $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password)
+ $ctx.ExecuteQuery()
+ $global:ctx=$ctx
}
-
$global:ctx
@@ -77,4 +64,4 @@ $ContentTypesEnabled =$false
Connect-SPOCSOM -Username $Username -AdminPassword $AdminPassword -Url $Url
-Set-SPOList -ListName $ListName -ContentTypesEnabled $ContentTypesEnabled
\ No newline at end of file
+Set-SPOList -ListName $ListName -ContentTypesEnabled $ContentTypesEnabled
diff --git a/Content Types/Create/Add Content Type to Lists with Workflows/description.md b/Content Types/Create/Add Content Type to Lists with Workflows/description.md
index 29aee1dd..b97da707 100644
--- a/Content Types/Create/Add Content Type to Lists with Workflows/description.md
+++ b/Content Types/Create/Add Content Type to Lists with Workflows/description.md
@@ -9,11 +9,9 @@ http://social.technet.microsoft.com/wiki/contents/articles/31051.sharepoint-onli
### How to use?
+1. Download and install [SharePoint Online SDK](https://www.microsoft.com/en-us/download/details.aspx?id=42038).
-
-1. Download and install SharePoint Online SDK.
-
-2. Download the .ps1 file.
+2. Download the *.ps1* file.
3. Open the file (you can do it also in NotePad)
@@ -33,15 +31,14 @@ $Name="Name of the Content Type2"
$ParentContentTypeID="0x01"
$Group="List Content Types"
```
-a) Find on your computer where SharePoint.Clitent.dll and SharePoint.Client.Runtime.dll libraries are located and insert the correct paths
-b) Instead of "admin@tenant.onmicrosoft.com" enter you username
-c) Instead of "https://tenant.sharepoint.com/sites/teamsitewithlibraries" enter the name of the site collection where you want to find the content types
-d) Fill in the properties of the content type.
+a) Find on your computer where SharePoint.Clitent.dll and SharePoint.Client.Runtime.dll libraries are located and insert the correct paths
+b) Instead of "admin@tenant.onmicrosoft.com" enter you username
+c) Instead of "https://tenant.sharepoint.com/sites/teamsitewithlibraries" enter the name of the site collection where you want to find the content types
+d) Fill in the properties of the content type.
-
5. Run the script in Powershell (any module).
-6. When the script has executed, Powershell will show a message Content Type Name of the Content Type2 has been added to Title of the List.
+6. When the script has executed, Powershell will show a message *Content Type Name of the Content Type2 has been added to Title of the List*.
Enjoy and please share feedback!
diff --git a/Content Types/Get/Get Names of all content types added to your lists/GetCTNamesinAllLists.ps1 b/Content Types/Get/Get Names of all content types added to your lists/GetCTNamesinAllLists.ps1
index d5c99a27..45c10140 100644
--- a/Content Types/Get/Get Names of all content types added to your lists/GetCTNamesinAllLists.ps1
+++ b/Content Types/Get/Get Names of all content types added to your lists/GetCTNamesinAllLists.ps1
@@ -1,64 +1,41 @@
-
-
-function Get-SPOList
-{
-
- param (
- [Parameter(Mandatory=$true,Position=1)]
+function Get-SPOList{
+ param (
+ [Parameter(Mandatory=$true,Position=1)]
[string]$Username,
[Parameter(Mandatory=$true,Position=2)]
$AdminPassword,
- [Parameter(Mandatory=$true,Position=3)]
+ [Parameter(Mandatory=$true,Position=3)]
[string]$Url
- )
-
- $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url)
- $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $AdminPassword)
- $ctx.ExecuteQuery()
-
- $ctx.Load($ctx.Web.Lists)
- $ctx.ExecuteQuery()
- Write-Host
- Write-Host $ctx.Url -BackgroundColor White -ForegroundColor DarkGreen
- foreach( $ll in $ctx.Web.Lists)
- {
+ )
- $ctx.Load($ll.ContentTypes)
+ $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url)
+ $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $AdminPassword)
+ $ctx.ExecuteQuery()
- try
- {
- $ctx.ExecuteQuery()
- }
- catch
- {
- }
+ $ctx.Load($ctx.Web.Lists)
+ $ctx.ExecuteQuery()
+ Write-Host
+ Write-Host $ctx.Url -BackgroundColor White -ForegroundColor DarkGreen
+ foreach( $ll in $ctx.Web.Lists){
+ $ctx.Load($ll.ContentTypes)
-
+ try{
+ $ctx.ExecuteQuery()
+ }
+ catch{
+ }
- Write-Host $ll.Title -ForegroundColor Green
-
- foreach($cc in $ll.ContentTypes)
- {
- Write-Output $cc.Name
- }
+ Write-Host $ll.Title -ForegroundColor Green
-
-
+ foreach($cc in $ll.ContentTypes){
+ Write-Output $cc.Name
+ }
-
-
- }
-
-
-
- }
-
-
-
-
-
+ }
+}
+
# Paths to SDK. Please verify location on your computer.
@@ -71,4 +48,4 @@ $AdminPassword=Read-Host -Prompt "Password" -AsSecureString
$AdminUrl="https://tenant.sharepoint.com/sites/teamsitewithlibraries"
-Get-SPOList -Username $Username -AdminPassword $AdminPassword -Url $AdminUrl
\ No newline at end of file
+Get-SPOList -Username $Username -AdminPassword $AdminPassword -Url $AdminUrl
diff --git a/Items Management/Attachments/Enable or disable attachments to items of a chosen list/ListAttachments.ps1 b/Items Management/Attachments/Enable or disable attachments to items of a chosen list/ListAttachments.ps1
index 275e2759..874aabc2 100644
--- a/Items Management/Attachments/Enable or disable attachments to items of a chosen list/ListAttachments.ps1
+++ b/Items Management/Attachments/Enable or disable attachments to items of a chosen list/ListAttachments.ps1
@@ -1,57 +1,49 @@
-
+
#
# Created by Arleta Wanat, 2015
#
-function Set-SPOList
-{
-param (
+function Set-SPOList{
+ param (
[Parameter(Mandatory=$true,Position=0)]
- [string]$ListName,
+ [string]$ListName,
[Parameter(Mandatory=$true,Position=1)]
- [bool]$Attachments
- )
+ [bool]$Attachments
+ )
-$ll=$ctx.Web.Lists.GetByTitle($ListName)
+ $ll=$ctx.Web.Lists.GetByTitle($ListName)
-$ll.EnableAttachments = $Attachments
- $ll.Update()
+ $ll.EnableAttachments = $Attachments
+ $ll.Update()
- try
- {
+ try{
$ctx.ExecuteQuery()
Write-Host "Done" -ForegroundColor Green
- }
-
- catch [Net.WebException]
- {
-
- Write-Host "Failed" $_.Exception.ToString() -ForegroundColor Red
- }
-
-
+ }
+ catch [Net.WebException] {
+ Write-Host "Failed" $_.Exception.ToString() -ForegroundColor Red
+ }
}
-function Connect-SPOCSOM
-{
- param (
- [Parameter(Mandatory=$true,Position=1)]
+function Connect-SPOCSOM{
+ param (
+ [Parameter(Mandatory=$true,Position=1)]
[string]$Username,
[Parameter(Mandatory=$true,Position=2)]
[string]$AdminPassword,
[Parameter(Mandatory=$true,Position=2)]
[string]$Url
-)
+ )
-$password = ConvertTo-SecureString -string $AdminPassword -AsPlainText -Force
+ $password = ConvertTo-SecureString -string $AdminPassword -AsPlainText -Force
$ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url)
$ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password)
$ctx.ExecuteQuery()
-$global:ctx=$ctx
+ $global:ctx=$ctx
}
@@ -78,4 +70,4 @@ $Attachments =$true
Connect-SPOCSOM -Username $Username -AdminPassword $AdminPassword -Url $Url
-Set-SPOList -ListName $ListName -Attachments $Attachments
\ No newline at end of file
+Set-SPOList -ListName $ListName -Attachments $Attachments
diff --git a/Items Management/Attachments/Enable or disable attachments to items of a chosen list/description.md b/Items Management/Attachments/Enable or disable attachments to items of a chosen list/description.md
index e17f799d..ae4331ff 100644
--- a/Items Management/Attachments/Enable or disable attachments to items of a chosen list/description.md
+++ b/Items Management/Attachments/Enable or disable attachments to items of a chosen list/description.md
@@ -1,22 +1,10 @@
-A short Powershell script to set the EnableAttachments property for a SharePoint Online list. The property is responsible for the Attach File icon under new item tab. If you disable the button, you and your users will not be able to add the attachments to list items.
+A short Powershell script to set the EnableAttachments property for a SharePoint Online list. The property is responsible for the **Attach File** icon under **new item** tab. If you disable the button, you and your users will not be able to add the attachments to list items.
-A short Powershell script to set the EnableAttachments property for a SharePoint Online list. The property is responsible for the Attach File icon under new item tab (see screenshot). The button allows you to add attachments to the list item.
-
-
-
-
-
-
-
-
+
If you disable the button, you and your users will not be able to add the attachments to list items:
-
-
-
-
-
+
Applies to lists.
@@ -24,7 +12,7 @@ Applies to lists.
-It requires installed SharePoint Online SDK
+It requires installed [SharePoint Online SDK](https://www.microsoft.com/en-us/download/details.aspx?id=42038)
You have to enter the list information before running the script:
@@ -45,18 +33,14 @@ $ListName="Tasks list"
$Attachments =$false
```
-### Related scripts
-Set direction of the reading order for a single list
+## **Related scripts**
+[Set direction of the reading order for a single list](https://gallery.technet.microsoft.com/office/Set-the-direction-of-the-f17ca66a)
-Set-SPOList properties (module)
-
-
-
-
+[Set-SPOList properties (module)](https://gallery.technet.microsoft.com/office/Set-SPOList-properties-9d16f2ba)
-### Related article
+## **Related article**
-SharePoint Online: Disable or enable attachments to list items using Powershell
+[SharePoint Online: Disable or enable attachments to list items using Powershell](https://social.technet.microsoft.com/wiki/contents/articles/30024.sharepoint-online-disable-or-enable-attachments-to-list-items-using-powershell.aspx)
diff --git a/SiteMailboxes/mailb.ps1 b/SiteMailboxes/mailb.ps1
index b2dc6dac..fbbf65f3 100644
--- a/SiteMailboxes/mailb.ps1
+++ b/SiteMailboxes/mailb.ps1
@@ -69,15 +69,11 @@ import-pssession $sesja
$sitecollections=Get-SPOSite
Write-Host "Found site collections:"
-foreach($sitecoll in $sitecollections)
-{
+foreach($sitecoll in $sitecollections){
Write-Host $sitecoll.Url
}
-
-
-function Add-MailboxToSite($urelek)
-{
+function Add-MailboxToSite($urelek){
$ctx = New-Object Microsoft.SharePoint.Client.ClientContext($urelek)
$ctx.Credentials= New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
$rootWeb = $ctx.Web
@@ -94,36 +90,30 @@ function Add-MailboxToSite($urelek)
new-sitemailbox -displayName $rootWeb.Title -SharePointUrl $rootWeb.Url
- foreach($site in $sites)
- {
+ foreach($site in $sites){
$site.Features.Add($featureguid, $true, [Microsoft.SharePoint.Client.FeatureDefinitionScope]::None) | Out-Null
$ctx.ExecuteQuery()
Write-Host "Feature enabled for" $site.Url
- }
- Write-Host "Finished enabling site mailbox feature on" $rootWeb.Title " : " $rootWeb.Url
-
+ }
+
+ Write-Host "Finished enabling site mailbox feature on" $rootWeb.Title " : " $rootWeb.Url
- foreach($site in $sites)
- {
- Write-Host "Trying to add mailbox for" $site.Url
- new-sitemailbox -displayName $site.Title -SharePointUrl $site.Url -ErrorAction SilentlyContinue | Out-Null }
+ foreach($site in $sites){
+ Write-Host "Trying to add mailbox for" $site.Url
+ new-sitemailbox -displayName $site.Title -SharePointUrl $site.Url -ErrorAction SilentlyContinue | Out-Null }
Write-Host "Finished adding mailboxes on" $rootWeb.Title " : " $rootWeb.Url
-
- if($ctx.Web.Webs.Count -gt 0)
- {
- for($i=0; $i -lt $ctx.Web.Webs.Count ; $i++)
- {
+ if($ctx.Web.Webs.Count -gt 0){
+ for($i=0; $i -lt $ctx.Web.Webs.Count ; $i++){
Add-MailboxToSite($ctx.Web.Webs[$i].Url)
}
}
}
- foreach($sitecoll in $sitecollections)
-{
- Add-MailboxToSite($sitecoll.Url)
-}
+ foreach($sitecoll in $sitecollections){
+ Add-MailboxToSite($sitecoll.Url)
+ }
#Finishes by saving a transcript of the whole run to a local folder
Stop-Transcript
diff --git a/SiteMailboxes/mailbox1.ps1 b/SiteMailboxes/mailbox1.ps1
index 65730096..adb4809c 100644
--- a/SiteMailboxes/mailbox1.ps1
+++ b/SiteMailboxes/mailbox1.ps1
@@ -78,22 +78,20 @@ new-sitemailbox -displayName $rootWeb.Title -SharePointUrl $rootWeb.Url
#adding the feature and the mailbox for all the subsites. It checks for first-level subsites. If your structure is more complex, you need to add more loops
- foreach($site in $sites)
- {
+foreach($site in $sites){
$site.Features.Add($featureguid, $true, [Microsoft.SharePoint.Client.FeatureDefinitionScope]::None)
$ctx.ExecuteQuery()
Write-Host "Feature enabled for" $site.Url
- }
- Write-Host "Finished enabling site mailbox feature."
+}
+
+Write-Host "Finished enabling site mailbox feature."
-
- foreach($site in $sites)
- {
+foreach($site in $sites){
new-sitemailbox -displayName $site.Title -SharePointUrl $site.Url
- }
+}
- Write-Host "Finished adding mailboxes."
+Write-Host "Finished adding mailboxes."
#Finishes by saving a transcript of the whole run to a local folder
- Stop-Transcript
\ No newline at end of file
+ Stop-Transcript