├── SharePoint 2019: bulk-add Managed Accounts using PowerShell ├── ManagedAccounts.csv ├── README.md └── Bulk Register Managed Account In SharePoint.ps1 ├── Change the "Link to Item Menu context" for different fields ├── README.md └── Change Link to Item Menu context for different fields in SharePoint List.ps1 ├── Update SharePoint Page Properties using PowerShell ├── Readme.MD └── Rename Page in SharePoint 2019 using PowerShell.ps1 ├── Replace SharePoint File Name using PowerShell ├── Readme.MD └── Replace word in SharePoint file using PowerShell.ps1 ├── LICENSE ├── Show and Hide Column in SharePoint List Forms Using PowerShell ├── README.md └── Show and Hide Column in SharePoint Forms Using PowerShell.ps1 ├── Export SharePoint Document Versions ├── Readme.md └── Export Documents Versions Details with Comments In SharePoint.ps1 ├── Get SharePoint 2016 Edition based on Product SKU using PowerShell ├── Detect_the_Installed_Edition_of_SharePoint_2016.ps1 └── ReadMe.MD ├── README.md ├── Get All Content Databases Details Per Farm ├── README.md └── SharePoint Content Database Scan Report.ps1 ├── Get all web applications, service applications and application pools per SharePoint farm ├── README.md └── SharePoint Web Application Scan Report.ps1 ├── Detect SharePoint Edition using PowerShell ├── ReadMe.MD └── Detect_the_Installed_Edition_of_SharePoint_2016_2013_2010.ps1 ├── Get All Site Collections and SubSites Per Farm ├── README.md └── SharePoint Site Collection Scan Report.ps1 └── SharePoint Farm Scan Report ├── README.md └── SharePoint Farm Scan Report.ps1 /SharePoint 2019: bulk-add Managed Accounts using PowerShell/ManagedAccounts.csv: -------------------------------------------------------------------------------- 1 | Service Account,Password 2 | domain\userName1,password 3 | domain\userName2,password 4 | domain\userName3,password 5 | -------------------------------------------------------------------------------- /SharePoint 2019: bulk-add Managed Accounts using PowerShell/README.md: -------------------------------------------------------------------------------- 1 | # [How to Bulk-Register Managed Account using PowerShell in SharePoint 2019](https://spgeeks.devoworx.com/bulk-add-managed-account-powershell-sharepoint/) 2 | 3 | ![SharePoint 2019: Bulk-Register Managed Account using PowerShell](https://spgeeks.devoworx.com/wp-content/uploads/2020/03/Configure-Manged-Accounts-in-SharePoint-2019.png) 4 | 5 | > Read Details at **[SharePoint 2019: Bulk-Register Managed Account using PowerShell](https://spgeeks.devoworx.com/bulk-add-managed-account-powershell-sharepoint/)** 6 | 7 | # Applies To 8 | 9 | - SharePoint Server 2019 10 | - SharePoint Server 2016 11 | - SharePoint Server 2010 12 | 13 | 14 | -------------------------------------------------------------------------------- /Change the "Link to Item Menu context" for different fields/README.md: -------------------------------------------------------------------------------- 1 | # [Linked to Item with Edit Menu in SharePoint List](https://spgeeks.devoworx.com/show-link-to-item-menu-field/) 2 | 3 | ![Linked to Item with Edit Menu in SharePoint List](https://i1.wp.com/spgeeks.devoworx.com/wp-content/uploads/2019/12/Change-a-link-to-item-Menu-for-a-field-in-SharePoint-List-Using-PowerShell.png) 4 | 5 | > Check the details at **[PowerShell: Manage Link to Item Menu in SharePoint List](https://spgeeks.devoworx.com/show-link-to-item-menu-field/)** 6 | # Applies To 7 | 8 | - SharePoint Server 2016 9 | - SharePoint Server 2013 10 | 11 | # See Also 12 | 13 | - [Link To Item for a different Column in SharePoint List](https://spgeeks.devoworx.com/enable-link-to-item-different-column/) 14 | -------------------------------------------------------------------------------- /Update SharePoint Page Properties using PowerShell/Readme.MD: -------------------------------------------------------------------------------- 1 | ![Update SharePoint Page Properties using PowerShell](https://user-images.githubusercontent.com/49816567/190545840-636a8728-cacb-4b72-b02d-7ca98b9fbabc.png) 2 | 3 | # [How to update Publishing Page Properties in SharePoint 2019 using PowerShell?](https://spgeeks.devoworx.com/update-page-properties-powershell-sharepoint-2019/) 4 | 5 | This PowerShell script helps you update the SharePoint Publshing Page Properties or File Properties and its Custom Fields using PowerShell. 6 | 7 | ![Update SharePoint Page Properties using PowerShell](https://spgeeks.devoworx.com/wp-content/uploads/2022/09/Update-file-Properties-PowerShell-in-SharePoint-2019.png) 8 | 9 | 10 | 11 | > Check how to use this script at **[SharePoint 2019: Update Page Properties using PowerShell](https://spgeeks.devoworx.com/update-page-properties-powershell-sharepoint-2019)** 12 | 13 | --------------- 14 | > **Have a related question? Please ask it at [deBUG.to](https://deBUG.to) Community** | **[Mohamed El-Qassas](https://devoworx.com)** 15 | -------------------------------------------------------------------------------- /Replace SharePoint File Name using PowerShell/Readme.MD: -------------------------------------------------------------------------------- 1 | ![How to replace sharepoint file name using Powershell](https://user-images.githubusercontent.com/49816567/190840918-87ee24d6-040a-4e25-be2a-a3f150d2d0f5.png) 2 | 3 | # [How to Replace SharePoint File Name using PowerShell?](https://spgeeks.devoworx.com/sharepoint-2019-replace-file-name-powershell/) 4 | 5 | This PowerShell script enables you to replace a certain word in a SharePoint File Name using PowerShell. 6 | 7 | ## How to use? 8 | 9 | Check how to use this script at **[SharePoint 2019: Replace File Name using PowerShell](https://spgeeks.devoworx.com/sharepoint-2019-replace-file-name-powershell/)** 10 | 11 | ## Output 12 | 13 | ![Update SharePoint Page Properties using PowerShell](https://i0.wp.com/spgeeks.devoworx.com/wp-content/uploads/2022/09/replace-file-name-using-Powershell-in-SharePoint-2019.png?w=723&ssl=1) 14 | 15 | ## Supported Versions 16 | - SharePoint 2019 17 | - SharePoint 2016 18 | 19 | --------------- 20 | 21 | > **Have a related question? Please ask it at [deBUG.to](https://deBUG.to) Community** | **[Mohamed El-Qassas](https://devoworx.com)** 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Mohamed El-Qassas 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Show and Hide Column in SharePoint List Forms Using PowerShell/README.md: -------------------------------------------------------------------------------- 1 | ![Show and Hide Column in SharePoint List Forms Using PowerShell1](https://user-images.githubusercontent.com/49816567/84558601-db78ee00-ad3c-11ea-80ab-2f124d0f166e.jpg) 2 | 3 | # [Show and Hide Column in SharePoint List Forms Using PowerShell](https://spgeeks.devoworx.com/show-hide-columns-in-sharepoint-list-forms/) 4 | 5 | This PowerShell Script helps you to show or hide columns in SharePoint List Forms. 6 | 7 | ![Show and Hide Column in SharePoint List Forms Using PowerShell](https://user-images.githubusercontent.com/49816567/84558698-66f27f00-ad3d-11ea-8374-8854c0932659.jpg) 8 | 9 | # How you can use this script? 10 | You can find the script features and the detail steps to use this script at **[Show and Hide Columns in SharePoint List Forms Using PowerShell](https://spgeeks.devoworx.com/show-hide-columns-in-sharepoint-list-forms/)** 11 | 12 | 13 | 14 | # Applies To 15 | 16 | - SharePoint 2019. 17 | - SharePoint 2016. 18 | - SharePoint 2013. 19 | - SharePoint 2010. 20 | 21 | -------------- 22 | > **Have a related question? Please ask it at [deBUG.to](https://deBUG.to) Community** | **[Mohamed El-Qassas](https://devoworx.com)** 23 | -------------------------------------------------------------------------------- /Export SharePoint Document Versions/Readme.md: -------------------------------------------------------------------------------- 1 | ![Export Documents Versions Details with Comments In SharePoint using PowerShell](https://user-images.githubusercontent.com/49816567/113259455-cf631a80-92d5-11eb-8acb-92e8045880fa.png) 2 | 3 | 4 | # [Export Documents Versions Details with Comments In SharePoint using PowerShell](https://spgeeks.devoworx.com/export-sharepoint-version-history-to-excel/) 5 | 6 | The **Export SharePoint Version History PowerShell Script** is a well-written and tested script that helps you to easily export all document version details with comments for a specific SharePoint document library. 7 | 8 | ![Export SharePoint Document Library Version Details to Excel](https://user-images.githubusercontent.com/49816567/113259154-7bf0cc80-92d5-11eb-96fa-11f5305cd37d.png) 9 | 10 | # How you can use this script? 11 | You can find the script features and the detail steps to run and use this script at **[Export SharePoint Version History to Excel Using PowerShell](https://spgeeks.devoworx.com/export-sharepoint-version-history-to-excel/)** 12 | 13 | 14 | 15 | # Applies To 16 | 17 | - SharePoint 2019. 18 | - SharePoint 2016. 19 | - SharePoint 2013. 20 | - SharePoint 2010. 21 | 22 | -------------- 23 | > **Have a related question? Please ask it at [deBUG.to](https://deBUG.to) Community** | **[Mohamed El-Qassas](https://devoworx.com)** 24 | -------------------------------------------------------------------------------- /Get SharePoint 2016 Edition based on Product SKU using PowerShell/Detect_the_Installed_Edition_of_SharePoint_2016.ps1: -------------------------------------------------------------------------------- 1 | # Author: Mohamed El-Qassas 2 | # Blog : blog.devoworx.net 3 | # Date : 08/19/2017 4 | # Description: 5 | #PowerShell Script to Detect the Installed SharePoint 2016 Edition 6 | 7 | #Add Add-PSSnapin Microsoft.SharePoint.PowerShell 8 | Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction Stop 9 | 10 | #Get SharePoint 2016 Edition 11 | function Get-SP2016Edition() 12 | { 13 | $SharePointEditionGuid = (Get-SPFarm).Products 14 | $SharePointEdition = switch ($SharePointEditionGuid) 15 | { 16 | 5DB351B8-C548-4C3C-BFD1-82308C9A519B {"The Installed SharePoint Edition is SharePoint 2016 Trail Edition."; Break} 17 | 4F593424-7178-467A-B612-D02D85C56940 {"The Installed SharePoint Edition is SharePoint 2016 Standard Edition."; Break} 18 | 716578D2-2029-4FF2-8053-637391A7E683 {"The Installed SharePoint Edition is SharePoint 2016 Enterprise Edition."; Break} 19 | } 20 | 21 | if($SharePointEdition -eq $null) 22 | { 23 | Write-Host "The SharePoint Edition can't be determined." -ForegroundColor Red 24 | } 25 | else 26 | { 27 | Write-Host $SharePointEdition -ForegroundColor Yellow 28 | Write-Host "The Biuld Version:" (Get-SPFarm).buildversion -ForegroundColor Yellow 29 | } 30 | } 31 | 32 | #Get SharePoint 2016 Edition 33 | Get-SP2016Edition -------------------------------------------------------------------------------- /Change the "Link to Item Menu context" for different fields/Change Link to Item Menu context for different fields in SharePoint List.ps1: -------------------------------------------------------------------------------- 1 | 2 | 3 | Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction Stop 4 | #Allow or disallow List Item Menu Context in SharePoint List. 5 | function Manage-ListItemMenu() 6 | { 7 | param ([string]$WebAppURL,[string]$List,[string]$Field,[bool]$Allow) 8 | Try 9 | { 10 | $Web = Get-SPWeb $WebAppURL 11 | $Lst = $web.Lists[$List] 12 | $Fld = $Lst.Fields[$Field] 13 | $msg = "The List Item Menu Context has been allowed for" 14 | if($Allow -eq $True) 15 | { 16 | Write-Host "Allow List Item Menu Context in SharePoint List" -ForegroundColor Green 17 | $Fld.ListItemMenuAllowed = "Required" 18 | $msg = "The List Item Menu Context has been allowed for" 19 | } 20 | else 21 | { 22 | Write-Host "DisAllow List Item Menu Context in SharePoint List" -ForegroundColor Green 23 | $Fld.ListItemMenuAllowed = "Prohibited" 24 | $msg = "The List Item Menu Context has been disallowed for" 25 | } 26 | 27 | #Reflect the Update 28 | $Fld.Update() 29 | $Lst.Update() 30 | Write-Host $msg $Field "successfully" -ForegroundColor Cyan 31 | 32 | } 33 | Catch 34 | { 35 | Write-Host $_.Exception.Message -ForegroundColor Red 36 | } 37 | } 38 | 39 | Manage-ListItemMenu -WebAppURL "http://epm:19812/PWA/" -List "LinkToItemMenu" -Field "Allow" -Allow $False 40 | 41 | -------------------------------------------------------------------------------- /SharePoint 2019: bulk-add Managed Accounts using PowerShell/Bulk Register Managed Account In SharePoint.ps1: -------------------------------------------------------------------------------- 1 | ####################################################### 2 | #Add Add-PSSnapin Microsoft.SharePoint.PowerShell 3 | Set-ExecutionPolicy "Unrestricted" 4 | Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction Stop 5 | ####################################################### 6 | #Add service account to managed account 7 | function Add-ManagedAccount() 8 | { 9 | Try 10 | { 11 | #Get Accounts from CSV 12 | Import-Csv F:\ManagedAccounts.csv | ForEach-Object { 13 | $ServiceAccount= $_."Service Account" 14 | $AccountPassword= $_.Password 15 | Write-Host "Adding the service Account" $ServiceAccount "to Managed Account" -ForegroundColor Green 16 | $srvacount = Get-SPManagedAccount | ? {$_.UserName -eq $ServiceAccount} 17 | if ($srvacount -eq $null) 18 | { 19 | $pass = convertto-securestring $AccountPassword -asplaintext -force 20 | $cred = new-object management.automation.pscredential $ServiceAccount ,$pass 21 | $res = New-SPManagedAccount -Credential $cred 22 | if ($res -ne $null) 23 | { 24 | Write-Host "The" $ServiceAccount "has been added successfully to Managed Account" -ForegroundColor Cyan 25 | } 26 | } 27 | else 28 | { 29 | Write-Host "The" $ServiceAccount "is already added to Managed Account" -ForegroundColor Yellow 30 | } 31 | } 32 | } 33 | Catch 34 | { 35 | Write-Host $_.Exception.Message -ForegroundColor Red 36 | break 37 | } 38 | } 39 | 40 | #Add bulk accounts to managed accounts using PowerShell 41 | Add-ManagedAccount -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![PowerShell Scripts for SharePoint on GitHub by SPGeeks-min](https://user-images.githubusercontent.com/49816567/77915045-7e25e280-729f-11ea-853f-38212521d17e.png) 2 | 3 | # PowerShell Scripts for SharePoint Server 4 | 5 | - [SharePoint Farm Scan Report](https://spgeeks.devoworx.com/sharepoint-farm-scan-report-powerhell-script/) 6 | - [Get All Web Applications Per Farm](https://spgeeks.devoworx.com/get-all-web-applications-per-farm/) 7 | - [Get All Content Databases Per Farm](https://spgeeks.devoworx.com/get-all-content-databases-per-farm/) 8 | - [Get All Site Collections and SubSites Per Farm](https://spgeeks.devoworx.com/all-site-collections-and-subsites-per-farm) 9 | - [Manage "Link to Item Edit" Menu for different fields in SharePoint List](https://spgeeks.devoworx.com/show-link-to-item-edit-menu-field/) 10 | - [SharePoint 2019: Bulk-Register Managed Accounts using PowerShell](https://spgeeks.devoworx.com/bulk-add-managed-account-powershell-sharepoint/) 11 | - [Project Server 2016 Configurator Script (Auto Installer)](https://gallery.technet.microsoft.com/PowerShell-Script-to-9993a79d) 12 | - [PowerShell Script to Detect the Installed SharePoint 2016 Edition](https://gallery.technet.microsoft.com/PowerShell-Script-to-52956bf7) 13 | - [Export the Version Comments and Version Details for each Document in SharePoint](https://gallery.technet.microsoft.com/Get-the-Version-Comments-4c82dac4) 14 | - [PowerShell: Create a SharePoint Site Collection in a Separate Content Database](https://gallery.technet.microsoft.com/PowerShell-Create-a-8776a51c) 15 | - [PowerShell Script to Detect the Installed SharePoint Edition / Version](https://gallery.technet.microsoft.com/PowerShell-Script-to-43d93449) 16 | 17 | 18 | ## Applied To 19 | - SharePoint 2019 20 | - SharePoint 2016 21 | - SharePoint 2013 22 | -------------- 23 | 24 | **Have a Question, Please ask [deBUG.to](https://deBUG.to) Community** | **[Mohamed El-Qassas](https://devoworx.com)** 25 | -------------------------------------------------------------------------------- /Get All Content Databases Details Per Farm/README.md: -------------------------------------------------------------------------------- 1 | # [Get All Content Databases Per Farm Using PowerShell](https://spgeeks.devoworx.com/get-all-content-databases-per-farm) 2 | 3 | ![Get All Content Databases Per Farm](https://i0.wp.com/spgeeks.devoworx.com/wp-content/uploads/2020/03/How-many-Content-Databases-List-Per-Farm.png) 4 | 5 | **This scripts helps you to get the below info:** 6 | 7 | - The list of all SharePoint Content Databases per farm. 8 | - The list of all SharePoint Content Databases per web application. 9 | - What’s the Current size per each Content Database? 10 | - How many site collections per content database? 11 | - What’s the associated web application for each content database? 12 | - A warning alert if the number of content databases per farm is exceeded the supported limit. 13 | - A warning alert if the size of a content database is exceeded the supported limit. 14 | 15 | ![Web-Application-Vs-Content-Database-Vs-Site-Collection-Vs-SubSite](https://user-images.githubusercontent.com/49816567/85030976-c8c04800-b186-11ea-96b0-24cd8d743e1c.gif) 16 | 17 | # How do the script work? 18 | 19 | Please, Check the detail explanation at **[Get All Content Databases Per Farm](https://spgeeks.devoworx.com/get-all-content-databases-per-farm)** to know how you can use this script. 20 | 21 | ![PowerShell Script to get all content databases per web application](https://i0.wp.com/spgeeks.devoworx.com/wp-content/uploads/2020/03/Get-Content-Database-size-Per-Web-Application-in-SharePoint-farm.png) 22 | 23 | # Applies To 24 | 25 | - SharePoint Server 2019 26 | - SharePoint Server 2016 27 | - SharePoint Server 2013 28 | 29 | # See Also 30 | 31 | - [SharePoint Farm Scan Report](https://spgeeks.devoworx.com/sharepoint-farm-scan-report-powerhell-script/) 32 | - [Get All Web Applications Per Farm](https://spgeeks.devoworx.com/get-all-web-applications-per-farm/) 33 | - [Get All Content Databases Per Farm](https://spgeeks.devoworx.com/get-all-content-databases-per-farm/) 34 | - [Get All Site Collections and SubSites Per Farm](https://spgeeks.devoworx.com/all-site-collections-and-subsites-per-farm) 35 | 36 | -------------------------------------------------------------------------------- /Get all web applications, service applications and application pools per SharePoint farm/README.md: -------------------------------------------------------------------------------- 1 | # [Get All Web Applications Per Farm Using PowerShell](https://spgeeks.devoworx.com/get-all-web-applications-per-farm) 2 | 3 | ![How many SharePoint Web Application Pools Per Farm-min](https://user-images.githubusercontent.com/49816567/77844218-5eae8d00-71ad-11ea-9bce-3ff29f0fc8a2.png) 4 | 5 | **This scripts helps you to get the below info:** 6 | 7 | - The list of all SharePoint web applications per farm. 8 | - The list of all SharePoint web application pools per web server. 9 | - The list of all SharePoint service application pools. 10 | - The list of running SharePoint service applications per farm. 11 | - A warning alert if the number of web applications is exceeded the supported limit. 12 | - A warning alert if the number of application pools is exceeded the threshold limit. 13 | 14 | ![Web-Application-Vs-Content-Database-Vs-Site-Collection-Vs-SubSite](https://user-images.githubusercontent.com/49816567/85030976-c8c04800-b186-11ea-96b0-24cd8d743e1c.gif) 15 | 16 | 17 | # How the script works? 18 | 19 | Please, Check the detail explanation at **[Get All Web Applications Per Farm](https://spgeeks.devoworx.com/get-all-web-applications-per-farm)** 20 | 21 | ![PowerShell Script to get all web applications, service applications and application pools per SharePoint farm](https://i1.wp.com/spgeeks.devoworx.com/wp-content/uploads/2020/03/PowerShell-Script-to-get-all-web-applications-and-application-pools-per-SharePoint-farm.png) 22 | 23 | 24 | # Applies To 25 | 26 | - SharePoint Server 2019 27 | - SharePoint Server 2016 28 | - SharePoint Server 2013 29 | 30 | # See Also 31 | 32 | - [SharePoint Farm Scan Report](https://spgeeks.devoworx.com/sharepoint-farm-scan-report-powerhell-script/) 33 | - [Get All Web Applications Per Farm](https://spgeeks.devoworx.com/get-all-web-applications-per-farm/) 34 | - [Get All Content Databases Per Farm](https://spgeeks.devoworx.com/get-all-content-databases-per-farm/) 35 | - [Get All Site Collections and SubSites Per Farm](https://spgeeks.devoworx.com/all-site-collections-and-subsites-per-farm) 36 | -------------------------------------------------------------------------------- /Detect SharePoint Edition using PowerShell/ReadMe.MD: -------------------------------------------------------------------------------- 1 | ![Detect SharePoint Edition Using PowerShell](https://user-images.githubusercontent.com/49816567/102154360-417c3480-3e8a-11eb-9f9b-a5be76f8e258.png) 2 | 3 | # [Detect SharePoint Edition Using PowerShell](https://spgeeks.devoworx.com/get-sharepoint-edition-powershell/) 4 | 5 | This script will help you to detect the Installed SharePoint Edition / Version and the Farm Build Number. 6 | 7 | > For more details, please check **[How to Get SharePoint Edition PowerShell?](https://spgeeks.devoworx.com/get-sharepoint-edition-powershell/)** 8 | 9 | ## How to Use? 10 | 11 | - Download the attached script file "Detect_the_Installed_Edition_of_SharePoint_2016_2013_2010.ps1" 12 | - Run ISE as Administrator. 13 | - Open the downloaded script file. 14 | - Click Run. 15 | 16 | ![PowerShell Script to Detect the Installed SharePoint 2016 Edition](https://user-images.githubusercontent.com/49816567/102153853-2d840300-3e89-11eb-989e-c1b23213590d.gif) 17 | 18 | ## Output 19 | 20 | Based on the current installed SharePoint, you will get the current SharePoint Edition and the build version as shown below 21 | 22 | ![Detect the Installed Edition of SharePoint 2016 2013 2010](https://user-images.githubusercontent.com/49816567/102154041-a4b99700-3e89-11eb-84be-1c1f0f208dc9.png) 23 | 24 | **Note** 25 | 26 | - The SharePoint Foundation 2013 is a subset of SharePoint Server 2013 so that if you have SharePoint Server (Standard / Enterprise) Edition, the SharePoint Foundation by default will be listed plus the current SharePoint Edition. 27 | - There is no SharePoint Foundation for SharePoint 2016 so that the script will show specifically which SharePoint 2016 (Standard / Enterprise) Edition has been installed. See also [SharePoint 2016 Foundation, What's the alternative?](https://spgeeks.devoworx.com/sharepoint-foundation-2016-whats-the-alternative/) 28 | 29 | 30 | 31 | ## Applies To 32 | 33 | - SharePoint 2016. 34 | - SharePoint 2013. 35 | - SharePoint 2010. 36 | 37 | 38 | > **Note:** this script has been migrated from my [TechNet Gallery ](https://gallery.technet.microsoft.com/PowerShell-Script-to-43d93449) 39 | 40 | -------------- 41 | 42 | **Have a Question, Please ask [deBUG.to](https://deBUG.to) Community** | **[Mohamed El-Qassas](https://devoworx.com)** 43 | -------------------------------------------------------------------------------- /Get All Site Collections and SubSites Per Farm/README.md: -------------------------------------------------------------------------------- 1 | # [Get All Site Collections and SubSites Per Farm Using PowerShell](https://spgeeks.devoworx.com/all-site-collections-and-subsites-per-farm/) 2 | 3 | ![Get All Site Collections and SubSites Per Farm](https://i1.wp.com/spgeeks.devoworx.com/wp-content/uploads/2020/03/Calculate-Site-Collection-size-per-each-content-database-using-PowerShell.png) 4 | 5 | **This scripts helps you to get the below info:** 6 | 7 | - The list of all SharePoint Site Collections per farm. 8 | - The list of all SharePoint Site Collections per web application. 9 | - The list of all SharePoint Site Collections per content database. 10 | - The list of all SharePoint Subsites per site collection. 11 | - Which Content Database stores the Site Collection? 12 | - What’s the current size of Site Collection? 13 | - How many site collections per farm? 14 | - How many site collections per each web application? 15 | - How many site collections per each content database? 16 | - How many Subsite per each site collection? 17 | - A warning alert if the supported limit exceeded. 18 | 19 | ![Web-Application-Vs-Content-Database-Vs-Site-Collection-Vs-SubSite](https://user-images.githubusercontent.com/49816567/85030976-c8c04800-b186-11ea-96b0-24cd8d743e1c.gif) 20 | 21 | 22 | # How the script works? 23 | 24 | Please, Check the detail explanation at **[Get All Site Collections and SubSites Per Farm](https://spgeeks.devoworx.com/all-site-collections-and-subsites-per-farm/)**. 25 | 26 | ![PowerShell Script to get all Site Collections and Subsites details Per SharePoint farm](https://i1.wp.com/spgeeks.devoworx.com/wp-content/uploads/2020/03/number-of-site-collections-per-content-database-in-SharePoint.png) 27 | 28 | 29 | # Applies To 30 | 31 | - SharePoint Server 2019 32 | - SharePoint Server 2016 33 | - SharePoint Server 2013 34 | 35 | # See Also 36 | 37 | - [SharePoint Farm Scan Report](https://spgeeks.devoworx.com/sharepoint-farm-scan-report-powerhell-script/) 38 | - [Get All Web Applications Per Farm](https://spgeeks.devoworx.com/get-all-web-applications-per-farm/) 39 | - [Get All Content Databases Per Farm](https://spgeeks.devoworx.com/get-all-content-databases-per-farm/) 40 | - [Get All Site Collections and SubSites Per Farm](https://spgeeks.devoworx.com/all-site-collections-and-subsites-per-farm) 41 | -------------------------------------------------------------------------------- /Get SharePoint 2016 Edition based on Product SKU using PowerShell/ReadMe.MD: -------------------------------------------------------------------------------- 1 | 2 | ![Get SharePoint 2016 Edition based on Product SKU using PowerShell](https://user-images.githubusercontent.com/49816567/102157256-362c0780-3e90-11eb-80a7-565e4d6353d1.png) 3 | 4 | # [Get SharePoint 2016 Edition based on Product SKU using PowerShell](https://spgeeks.devoworx.com/get-sharepoint-edition-powershell/) 5 | 6 | This script will help you to detect the Installed SharePoint 2016 Edition. 7 | 8 | - SharePoint 2016 Trail. 9 | - SharePoint 2016 Standard. 10 | - SharePoint 2016 Enterprise. 11 | 12 | It also detects the current farm build number. 13 | 14 | > For more details, please check **[How to Get SharePoint Edition PowerShell?](https://spgeeks.devoworx.com/get-sharepoint-edition-powershell/)** 15 | 16 | ## How to Use? 17 | 18 | - Download the attached script file "Detect_the_Installed_Edition_of_SharePoint_2016.ps1" 19 | - Run ISE as Administrator. 20 | - Open the downloaded script file. 21 | - Click Run. 22 | 23 | ![PowerShell Script to Detect the Installed SharePoint 2016 Edition](https://user-images.githubusercontent.com/49816567/102153853-2d840300-3e89-11eb-989e-c1b23213590d.gif) 24 | 25 | ## Output 26 | 27 | **(Test1)** You have SharePoint 2016, The script will work properly and get the current SharePoint Edition and the farm build number as shown below: 28 | 29 | ![PowerShell Script to Detect the Installed SharePoint 2016 Edition - EnterPrise (1)](https://user-images.githubusercontent.com/49816567/102157429-886d2880-3e90-11eb-9de9-6ca2e2c5007e.png) 30 | 31 | **(Test2)** You don't have SharePoint 2016, The script will inform you "The SharePoint Edition can't be determined" as shown below: 32 | 33 | ![PowerShell Script to Detect the Installed SharePoint 2016 Edition - Not (1)](https://user-images.githubusercontent.com/49816567/102157424-86a36500-3e90-11eb-857e-70df23971e09.png) 34 | 35 | **Note** 36 | 37 | - There is no SharePoint Foundation for SharePoint 2016 so that the script will show specifically which SharePoint 2016 (Standard / Enterprise) Edition has been installed. See also [SharePoint 2016 Foundation, What's the alternative?](https://spgeeks.devoworx.com/sharepoint-foundation-2016-whats-the-alternative/) 38 | 39 | 40 | 41 | ## Applies To 42 | 43 | - SharePoint 2016. 44 | 45 | 46 | > **Note:** this script has been migrated from my [TechNet Gallery ](https://gallery.technet.microsoft.com/PowerShell-Script-to-52956bf7) 47 | 48 | ## See Also 49 | 50 | - [Detect SharePoint Edition Using PowerShell](https://github.com/melqassas/PSforSharePoint/blob/master/Detect%20SharePoint%20Edition%20using%20PowerShell/) 51 | 52 | 53 | 54 | -------------- 55 | 56 | **Have a Question, Please ask [deBUG.to](https://deBUG.to) Community** | **[Mohamed El-Qassas](https://devoworx.com)** 57 | -------------------------------------------------------------------------------- /Replace SharePoint File Name using PowerShell/Replace word in SharePoint file using PowerShell.ps1: -------------------------------------------------------------------------------- 1 | #Replace a specific word in file name using PowerShell in SharePoint Server 2019,2016 2 | #Author: Mohamed El-Qassas 3 | 4 | Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue 5 | 6 | $siteURL = "http://epm:19812/sites/pp/" 7 | $DocLibName = "Documentss" 8 | $oldword = "qassas" 9 | $newword = "debug" 10 | 11 | 12 | $TotalfileCounts =0 13 | $filesupdatedCount= 0 14 | try 15 | { 16 | 17 | $SPWeb = Get-SPWeb $siteURL -ErrorAction SilentlyContinue 18 | #Check if site is correct 19 | if ($SPWeb -ne $null) 20 | { 21 | $DocLib = $SPWeb.Lists[$DocLibName] 22 | #Check if cocument library is exist 23 | if($DocLib -ne $null) 24 | { 25 | $TotalfileCounts = $DocLib.Items.Count 26 | Write-host "The total number of files in ($DocLibName) is ($TotalfileCounts)" -ForegroundColor Cyan 27 | foreach($ListItem in $DocLib.Items) 28 | { 29 | $fileName = $ListItem["Name"] 30 | if($fileName.ToLower().Contains($oldword)) 31 | { 32 | 33 | $filesupdatedCount = $filesupdatedCount +1 34 | if($ListItem.File.CheckedOutByUser -eq $null) #if the file is not checked out 35 | { 36 | $ListItem.File.CheckOut() #check the file out 37 | } 38 | 39 | 40 | $ListItem["Name"] = $ListItem["Name"].replace($oldword,$newword) #replace 41 | $ListItem["Comment"] ="File has been Updated by PowerShell" 42 | $ListItem.Update() 43 | $ListItem.File.CheckIn("File has been Updated by PowerShell",[Microsoft.SharePoint.SPCheckinType]::MajorCheckIn) 44 | $NewfileName = $ListItem["Name"] 45 | Write-Host "- The file '$fileName' name been updated to '$NewfileName'" -ForegroundColor Yellow 46 | } 47 | } 48 | Write-host "The total number of updated files in ($DocLibName) is ($filesupdatedCount)" -ForegroundColor Cyan 49 | } else {Write-Host "The specified document library ($DocLibName) is not found, Please specifiy an exisiting and correct Document Library Name" -ForegroundColor Red} 50 | 51 | 52 | $SPWeb.Dispose() 53 | } else {Write-Host "The specified site ($siteURL) is not found, Please specifiy an exisiting site URL" -ForegroundColor Red} 54 | } 55 | catch 56 | { 57 | Write-Host "An error occurred:" 58 | Write-Host $_ -ForegroundColor Red 59 | } -------------------------------------------------------------------------------- /Update SharePoint Page Properties using PowerShell/Rename Page in SharePoint 2019 using PowerShell.ps1: -------------------------------------------------------------------------------- 1 | #Update Publishing Page Properties in SharePoint Server 2019,2016 2 | #Author: Mohamed El-Qassas 3 | 4 | Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue 5 | 6 | $siteURL = "http://epm:19812/sites/pp/" 7 | $CurrentPageURL = "http://epm:19812/sites/pp/Documents/devo1.png" 8 | $NewPageURL = "http://epm:19812/sites/pp/Documents/debug.png" 9 | $NewpageName = "debug" 10 | $NewpageTitle = "debug" 11 | 12 | try 13 | { 14 | 15 | $SPWeb = Get-SPWeb $siteURL -ErrorAction SilentlyContinue 16 | #Check if site is correct 17 | if ($SPWeb -ne $null) 18 | { 19 | #Check if new file name is not exist 20 | $CheckNewFile = $spWeb.GetFile($NewPageURL) 21 | if ($CheckNewFile."Exists" -ne $false) 22 | { 23 | Write-Host "The specified name ($NewpageName) is already in use, Please specifiy another page name" -ForegroundColor Red 24 | } 25 | else 26 | { 27 | 28 | $SPpage = $spWeb.GetFile($CurrentPageURL); 29 | [Microsoft.SharePoint.SPListItem]$SPListItem = $SPpage.Item 30 | 31 | #Check if the current file is exist 32 | if ($SPListItem -ne $null) 33 | { 34 | if($SPpage.CheckOutType -eq "None" -And $SPpage.LockType -eq "None") 35 | 36 | { 37 | $SPpage.CheckOut() 38 | } 39 | 40 | $SPListItem["Name"] = $NewpageName 41 | $SPListItem["Title"] = $NewpageTitle 42 | #Cusotm fields, in your case you have to set your custom fields name 43 | $SPListItem["Comment"] = "File has been updated by PowerShell" 44 | $SPListItem.Update(); 45 | $SPpage = $SPWeb.GetFile($NewPageURL); 46 | $SPpage.CheckIn("Page Updated",[Microsoft.SharePoint.SPCheckinType]::MajorCheckIn) 47 | Write-Host "the $SPpage name and title has been updated" -ForegroundColor Yellow 48 | Start-Process $NewPageURL 49 | 50 | } 51 | else 52 | { 53 | Write-Host "the $SPpage is not found" -ForegroundColor Red 54 | } 55 | } 56 | 57 | $SPWeb.Dispose() 58 | } 59 | else {Write-Host "The specified site ($siteURL) is not found, Please specifiy an exisiting site URL" -ForegroundColor Red} 60 | } 61 | catch 62 | { 63 | Write-Host "An error occurred:" 64 | Write-Host $_ -ForegroundColor Red 65 | } -------------------------------------------------------------------------------- /Detect SharePoint Edition using PowerShell/Detect_the_Installed_Edition_of_SharePoint_2016_2013_2010.ps1: -------------------------------------------------------------------------------- 1 | # Author: Mohamed El-Qassas 2 | # Blog : blog.devoworx.net 3 | # Date : 08/19/2017 4 | # Description: PowerShell Script to Detect the Installed Edition of SharePoint 2016 - 2013 -2010 5 | 6 | #Add Add-PSSnapin Microsoft.SharePoint.PowerShell 7 | Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction Stop 8 | 9 | #Get SharePoint Edition 10 | function Get-SharePointEdition() 11 | { 12 | Write-Host "-----------------------------------------------------------------------" -ForegroundColor yellow 13 | Write-Host "The Installed SharePoint" -ForegroundColor yellow 14 | Write-Host "-----------------------------------------------------------------------" -ForegroundColor yellow 15 | $SharePointEditionGuid = (Get-SPFarm).Products 16 | switch ($SharePointEditionGuid) 17 | { 18 | #SharePoint 2016 Editions 19 | 5DB351B8-C548-4C3C-BFD1-82308C9A519B {"SharePoint 2016 Trail."} 20 | 4F593424-7178-467A-B612-D02D85C56940 {"SharePoint 2016 Standard."} 21 | 716578D2-2029-4FF2-8053-637391A7E683 {"SharePoint 2016 Enterprise."} 22 | #SharePoint 2013 Editions 23 | 9FF54EBC-8C12-47D7-854F-3865D4BE8118 {"SharePoint Foundation 2013."} 24 | 35466B1A-B17B-4DFB-A703-F74E2A1F5F5E {"SharePoint Server 2013 Enterprise plus Project Server 2013.";break} 25 | BC7BAF08-4D97-462C-8411-341052402E71 {"SharePoint Server 2013 Enterprise plus Project Server 2013 Trail.";break} 26 | B7D84C2B-0754-49E4-B7BE-7EE321DCE0A9 {"SharePoint Server 2013 Enterprise."} 27 | 298A586A-E3C1-42F0-AFE0-4BCFDC2E7CD0 {"SharePoint Server 2013 Enterprise Trail."} 28 | C5D855EE-F32B-4A1C-97A8-F0A28CE02F9C {"SharePoint Server 2013."} 29 | CBF97833-C73A-4BAF-9ED3-D47B3CFF51BE {"SharePoint Server 2013 Trail."} 30 | #SharePoint 2010 Editions 31 | BEED1F75-C398-4447-AEF1-E66E1F0DF91E {"SharePoint Foundation 2010."} 32 | B2C0B444-3914-4ACB-A0B8-7CF50A8F7AA0 {"SharePoint Server 2010 Standard Trial."} 33 | 3FDFBCC8-B3E4-4482-91FA-122C6432805C {"SharePoint Server 2010 Standard."} 34 | 88BED06D-8C6B-4E62-AB01-546D6005FE97 {"SharePoint Server 2010 Enterprise Trial."} 35 | D5595F62-449B-4061-B0B2-0CBAD410BB51 {"SharePoint Server 2010 Enterprise."} 36 | 84902853-59F6-4B20-BC7C-DE4F419FEFAD {"Project Server 2010 Trial."} 37 | ED21638F-97FF-4A65-AD9B-6889B93065E2 {"Project Server 2010."} 38 | default {"The SharePoint edition can't be determined"} 39 | } 40 | 41 | Write-Host "-----------------------------------------------------------------------" -ForegroundColor yellow 42 | Write-Host "The Biuld Version" -ForegroundColor yellow 43 | Write-Host "-----------------------------------------------------------------------" -ForegroundColor yellow 44 | Write-Host (Get-SPFarm).buildversion 45 | 46 | } 47 | 48 | #Get SharePoint Edition 49 | Get-SharePointEdition -------------------------------------------------------------------------------- /SharePoint Farm Scan Report/README.md: -------------------------------------------------------------------------------- 1 | # [SharePoint Farm Scan Report PowerShell Script](https://spgeeks.devoworx.com/sharepoint-farm-scan-report-powerhell-script/) 2 | 3 | ![SharePoint Farm Scan Report PowerShell Script](https://i1.wp.com/spgeeks.devoworx.com/wp-content/uploads/2020/03/SharePoint-Farm-Scan-Report-PowerShell-Script.png) 4 | 5 | **[SharePoint Farm Scan Report](https://spgeeks.devoworx.com/sharepoint-farm-scan-report-powerhell-script/)** is a PowerShell script that would help you to scan farm objects to monitor the SharePoint farm limits by getting real statistics that would help you to administrate your farm effectively and efficiently. 6 | 7 | ![Web-Application-Vs-Content-Database-Vs-Site-Collection-Vs-SubSite](https://user-images.githubusercontent.com/49816567/85030976-c8c04800-b186-11ea-96b0-24cd8d743e1c.gif) 8 | 9 | **This scripts helps you to get the below info:** 10 | 11 | - List of SharePoint web applications per farm. 12 | - The number of SharePoint web applications per farm. 13 | - List of SharePoint Application Pools. 14 | - The number of SharePoint application pools. 15 | - List of running SharePoint service applications per farm. 16 | - The number of running SharePoint service applications per farm. 17 | - List of SharePoint content databases per farm. 18 | - The number of SharePoint content databases per farm. 19 | - List of SharePoint content databases per web application. 20 | - The number of SharePoint content databases per web application. 21 | - What’s the current content database size? 22 | - List of SharePoint site collections per farm 23 | - The number of SharePoint site collections per farm. 24 | - List of SharePoint site collections per web application 25 | - The number of SharePoint site collections per web application. 26 | - List of SharePoint site collections per content database. 27 | - The number of site collections per content database. 28 | - Which content database stores the site collection? 29 | - What’s the Site collection size? 30 | - List of SharePoint SubSites Per farm. 31 | - The number of SharePoint SubSites per farm. 32 | - List of SharePoint SubSites per site collection. 33 | - Total number of SubSites per site collection. 34 | - Farm Report Summary. 35 | 36 | ![PowerShell Script to get all Site Collections and Subsites details Per SharePoint farm](https://i1.wp.com/spgeeks.devoworx.com/wp-content/uploads/2020/03/number-of-site-collections-per-content-database-in-SharePoint.png) 37 | 38 | > Please, Check the detail explanation at **[PowerShell Script: SharePoint Farm Scan Report](https://spgeeks.devoworx.com/sharepoint-farm-scan-report-powerhell-script/)** 39 | 40 | # Applies To 41 | 42 | - SharePoint Server 2019 43 | - SharePoint Server 2016 44 | - SharePoint Server 2013 45 | - SharePoint Server 2010 46 | 47 | # See Also 48 | 49 | - [SharePoint Farm Scan Report](https://spgeeks.devoworx.com/sharepoint-farm-scan-report-powerhell-script/) 50 | - [Get All Web Applications Per Farm](https://spgeeks.devoworx.com/get-all-web-applications-per-farm/) 51 | - [Get All Content Databases Per Farm](https://spgeeks.devoworx.com/get-all-content-databases-per-farm/) 52 | - [Get All Site Collections and SubSites Per Farm](https://spgeeks.devoworx.com/all-site-collections-and-subsites-per-farm) 53 | 54 | -------------------------------------------------------------------------------- /Show and Hide Column in SharePoint List Forms Using PowerShell/Show and Hide Column in SharePoint Forms Using PowerShell.ps1: -------------------------------------------------------------------------------- 1 | ####################################################### 2 | #Author: Mohamed El-Qassas 3 | #About Author: https://devoworx.com 4 | #Script Name: Show and Hide Column in SharePoint List Forms Using PowerShell 5 | #Check the details at: https://spgeeks.devoworx.com/all-site-collections-and-subsites-per-farm 6 | #Have a Question: Ask it at https://debug.to 7 | ####################################################### 8 | #Add Add-PSSnapin Microsoft.SharePoint.PowerShell 9 | Set-ExecutionPolicy "Unrestricted" 10 | Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction Stop 11 | ####################################################### 12 | function ShowHide_SPColumn() 13 | { 14 | param([string]$SiteURL,$ListTitle,$FieldName,$FormType,[bool]$Show) 15 | 16 | try{ 17 | $web = Get-SPWeb -Site $SiteURL 18 | $list = $web.lists | Where-Object { $_.title -Eq $ListTitle } 19 | if($list) 20 | { 21 | if($Show -eq $true){ 22 | $Action = "Show" 23 | } 24 | else 25 | { 26 | $Action = "Hide" 27 | } 28 | 29 | $reply = Read-Host -Prompt "Are you sure you would like to $Action '$FieldName' column in '$FormType form' in '$list' list?[y/n]" 30 | if ( $reply -match "[yY]" ) { 31 | $Fields= $list.Fields 32 | $RField= $Fields[$FieldName] 33 | foreach ($Field in $Fields) 34 | { 35 | if($Field -eq $RField) 36 | { 37 | $found = $true 38 | switch($FormType) 39 | { 40 | "New" {$RField.ShowInNewForm=$Show; break} 41 | "Edit" {$RField.ShowInEditForm=$Show; break} 42 | "Display" {$RField.ShowInDisplayForm=$Show; break} 43 | "All" {$RField.ShowInNewForm=$Show;$RField.ShowInEditForm=$Show;$RField.ShowInDisplayForm=$Show; break} 44 | default {$RField.ShowInNewForm=$false; break} 45 | } 46 | $RField.Update() 47 | if($Show -eq $true){ 48 | Write-Host "This field '$FieldName' has been shown in '$FormType form' successfully" -ForegroundColor Green 49 | } 50 | else 51 | { 52 | Write-Host "This field '$FieldName' has been hidden in '$FormType form' successfully" -ForegroundColor Green 53 | } 54 | break; 55 | } 56 | 57 | } 58 | if(!$found) 59 | { 60 | Write-Host "This field '$FieldName' is not found in '$list'" -ForegroundColor Yellow 61 | Write-Host "The available fields in '$list' list" -ForegroundColor Cyan 62 | $Fields | select title 63 | } 64 | } 65 | 66 | } 67 | else 68 | { 69 | Write-Host "This list '$ListTitle' is not found, please make sure you have typed the list title and site URL correctly" -ForegroundColor Yellow 70 | } 71 | 72 | } 73 | Catch 74 | { 75 | Write-Host $_.Exception.Message -ForegroundColor Red 76 | break 77 | } 78 | } 79 | 80 | # -FormType "New" or "Edit" or "Display" or"All" 81 | ShowHide_SPColumn -SiteURL "http://epm:19812" -ListTitle "Show and Hide SharePoint Column" -FieldName "Test" -FormType "All" -Show $false 82 | 83 | -------------------------------------------------------------------------------- /Get All Content Databases Details Per Farm/SharePoint Content Database Scan Report.ps1: -------------------------------------------------------------------------------- 1 | ####################################################### 2 | #Author: Mohamed El-Qassas 3 | #About Author: https://devoworx.com 4 | #Script Name: SharePoint Farm Statistics Scan Report 5 | #Script Description: list all details for Content Databases 6 | #Check the details at: https://spgeeks.devoworx.com/get-all-content-databases-per-farm/ 7 | #Check the Full Script details at: https://spgeeks.devoworx.com/sharepoint-farm-scan-report/ 8 | #Have a Question: Ask it at https://debug.to 9 | ####################################################### 10 | #Add Add-PSSnapin Microsoft.SharePoint.PowerShell 11 | Set-ExecutionPolicy "Unrestricted" 12 | Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction Stop 13 | ####################################################### 14 | function SPCDBScanReport() 15 | { 16 | 17 | Try 18 | { 19 | Write-Host "SharePoint Content Database Scan Report" -ForegroundColor cyan 20 | Write-Host "--------------------------------------------------------------------" 21 | $ex = "Exceed the Supported Limit" 22 | $wa = "Within the Limit" 23 | #SharePoint Web Application 24 | $SPWebApp = Get-SPWebApplication 25 | # Content Databases 26 | $ContentDB = Get-SPContentDatabase | select name,WebApplication,@{Name="Contenet Database Size (GB)"; Expression={[math]::Round($_.disksizerequired/1024MB,2)}},@{Name="Within the Limit"; Expression={if([math]::Round($_.disksizerequired/1024MB,2) -ge 200){ "No"} else {"Yes"}}} 27 | $ContentDBcount = $ContentDB.count 28 | 29 | 30 | ################################################################################## 31 | #How Many SharePoint Content Database Per farm 32 | Write-Host "SharePoint Content Database Per farm" -ForegroundColor cyan 33 | Write-Host "The supported limit for SharePoint Content Databases per farm is 500 content databases." 34 | switch($ContentDBcount) 35 | { 36 | {$_ -ge 500} {Write-Host "Total Number of SharePoint Content Database:" $_ "|"$ex -ForegroundColor red } 37 | {$_ -lt 500} {Write-Host "Total Number of SharePoint Content Database:" $_ "|"$wa -ForegroundColor yellow} 38 | } 39 | $ContentDB | Format-List 40 | Write-Host "For more details, please check https://spgeeks.devoworx.com/sql-server-best-practices-sharepoint/" -ForegroundColor cyan 41 | Write-Host "--------------------------------------------------------------------" 42 | 43 | 44 | ################################################################################## 45 | #How Many SharePoint Content Database Per Web Application 46 | Write-Host "SharePoint Content Database Per Web Application" -ForegroundColor cyan 47 | foreach($WebApp in $SPWebApp){ 48 | Write-Host "The Total Number of Content Database per Web Application" $WebApp.Url "is" (Get-SPContentDatabase -WebApplication $WebApp).count -ForegroundColor green 49 | Get-SPContentDatabase -WebApplication $WebApp | select name,@{Name="Contenet Database Size (GB)"; Expression={[math]::Round($_.disksizerequired/1024MB,2)}},@{Name="Within the Limit"; Expression={if([math]::Round($_.disksizerequired/1024MB,2) -ge 200){ "No"} else {"Yes"}}} | format-list 50 | Write-Host "---------------------------------" 51 | } 52 | 53 | 54 | ################################################################################## 55 | #Content Database Scan Report Summary 56 | Write-Host "Content Database Scan Report Summary" -ForegroundColor Green 57 | Write-Host "Total Number of SharePoint Content Database Per Farm:" $ContentDBcount 58 | Write-Host "Check the details at: https://spgeeks.devoworx.com/get-all-content-databases-per-farm/" -ForegroundColor cyan 59 | Write-Host "Check also the SharePoint Farm Scan Report at https://spgeeks.devoworx.com/sharepoint-farm-scan-report/" -ForegroundColor cyan 60 | Write-Host "--------------------------------------------------------------------" 61 | } 62 | Catch 63 | { 64 | Write-Host $_.Exception.Message -ForegroundColor Red 65 | } 66 | } 67 | 68 | #Run SharePoint Content Database Scan Report 69 | SPCDBScanReport -------------------------------------------------------------------------------- /Get all web applications, service applications and application pools per SharePoint farm/SharePoint Web Application Scan Report.ps1: -------------------------------------------------------------------------------- 1 | ####################################################### 2 | #Author: Mohamed El-Qassas 3 | #About Author: https://devoworx.com 4 | #Script Name: SharePoint Web Application Scan Report 5 | #Script Description: list all details for Web Application, Application Pool, Running Service Application 6 | #Check the details at: https://spgeeks.devoworx.com/get-all-web-applications-per-farm/ 7 | #Check the Full Script details at: https://spgeeks.devoworx.com/sharepoint-farm-scan-report/ 8 | #Have a Question: Ask it at https://debug.to 9 | ####################################################### 10 | #Add Add-PSSnapin Microsoft.SharePoint.PowerShell 11 | Set-ExecutionPolicy "Unrestricted" 12 | Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction Stop 13 | ####################################################### 14 | function SPWebAppScanReport() 15 | { 16 | 17 | Try 18 | { 19 | Write-Host "SharePoint Web Application Scan Report" -ForegroundColor cyan 20 | Write-Host "--------------------------------------------------------------------" 21 | $ex = "Exceed the Supported Limit" 22 | $wa = "Within the Limit" 23 | #SharePoint Web Application 24 | $SPWebApp = Get-SPWebApplication 25 | $SPWebAppcount = $SPWebApp.count 26 | #SharePoint Web Application Pool 27 | $SPWebAppPool = Get-SPWebApplication | select ApplicationPool -Unique 28 | #SharePoint Service Application Pool 29 | $SPSrvWebAppPool = Get-SPServiceApplicationPool | Select -Unique 30 | $SPAppPoolCount = $SPSrvWebAppPool.count + $SPWebAppPool.count 31 | #SharePoint Service Applications 32 | $SPSrvApp = Get-SPServiceApplication | select id,name 33 | $SPSrvAppcount= $SPSrvApp.count 34 | 35 | 36 | ################################################################################## 37 | #How Many Web Applications in farm 38 | Write-Host "SharePoint Web Applications per Farm" -ForegroundColor cyan 39 | Write-Host "The supported limit for the SharePoint web application per farm is 20 web applications." 40 | switch($SPWebAppcount) 41 | { 42 | {$_ -ge 20} {Write-Host "Total Number of SharePoint Web Application:" $_ "|"$ex -ForegroundColor red } 43 | {$_ -lt 20} {Write-Host "Total Number of SharePoint Web Application:" $_ "|"$wa -ForegroundColor yellow} 44 | } 45 | $SPWebApp 46 | Write-Host "For more details, please check https://spgeeks.devoworx.com/sharepoint-2019-limitations" -ForegroundColor cyan 47 | Write-Host "--------------------------------------------------------------------" 48 | 49 | 50 | ################################################################################## 51 | #How Many SharePoint Web Application Pools for the web server Per farm 52 | Write-Host "SharePoint Web Application Pools for the web server Per farm" -ForegroundColor cyan 53 | Write-Host "SharePoint Application Pool Limits for Web Server per Farm is 10 Application Pools (This limit depends mainly on the Server Hardware specifications)." 54 | switch($SPAppPoolCount) 55 | { 56 | {$_ -ge 10} {Write-Host "Total Number of SharePoint Application Pool:" $_ "|"$ex -ForegroundColor red } 57 | {$_ -lt 10} {Write-Host "Total Number of SharePoint Application Pool:" $_ "|"$wa -ForegroundColor yellow} 58 | } 59 | $SPWebAppPool 60 | $SPSrvWebAppPool | select name 61 | Write-Host "For more details, please check https://spgeeks.devoworx.com/sharepoint-2019-service-accounts-best-practice/" -ForegroundColor cyan 62 | Write-Host "--------------------------------------------------------------------" 63 | 64 | 65 | ################################################################################## 66 | #How Many SharePoint Service Applications Running on farm 67 | Write-Host "Running SharePoint Service Applications" -ForegroundColor cyan 68 | Write-Host "Total Number of Running SharePoint Service Applications:" $SPSrvApp.count -ForegroundColor Green 69 | $SPSrvApp 70 | Write-Host "--------------------------------------------------------------------" 71 | 72 | 73 | ################################################################################## 74 | #Web Application Report Summary 75 | Write-Host "Web Application Report Summary" -ForegroundColor Green 76 | Write-Host "Total Number of SharePoint Web Application Per Farm:" $SPWebAppcount 77 | Write-Host "Total Number of SharePoint Application Pool Per Farm:" $SPAppPoolCount 78 | Write-Host "Total Number of SharePoint Service Application Per Farm:" $SPSrvAppcount 79 | Write-Host "Check the details at: https://spgeeks.devoworx.com/get-all-web-applications-per-farm/" -ForegroundColor cyan 80 | Write-Host "Check also the SharePoint Farm Scan Report at https://spgeeks.devoworx.com/sharepoint-farm-scan-report/" -ForegroundColor cyan 81 | Write-Host "--------------------------------------------------------------------" 82 | } 83 | Catch 84 | { 85 | Write-Host $_.Exception.Message -ForegroundColor Red 86 | } 87 | } 88 | 89 | #Run SharePoint Web APplication Scan Report 90 | SPWebAppScanReport -------------------------------------------------------------------------------- /Export SharePoint Document Versions/Export Documents Versions Details with Comments In SharePoint.ps1: -------------------------------------------------------------------------------- 1 | # Author: Mohamed El-Qassas 2 | # Blog : https://devoworx.com 3 | # Date : 04/01/2021 4 | # Read instrcutions at https://spgeeks.devoworx.com 5 | # Description: PowerShell Script to Get the Version Comments for each Document and other Version Details in SharePoint Document Library 6 | # Have a quiestion, Please ask it at https://debug.to 7 | 8 | #Add Add-PSSnapin Microsoft.SharePoint.PowerShell 9 | Set-ExecutionPolicy "Unrestricted" 10 | Add-PSSnapin "Microsoft.SharePoint.PowerShell" 11 | #Variables 12 | function ExportDocLibVersions () 13 | { 14 | param([string]$siteURL,$DocLibName) 15 | try 16 | { 17 | 18 | #################################################################### 19 | 20 | #Get the Web and document library 21 | $WebSite = Get-SPWeb $siteURL 22 | $DocLib = $WebSite.Lists.TryGetList($DocLibName) 23 | #################################################################### 24 | 25 | #Check if the version settings is enabled to proceed 26 | 27 | If ($DocLib.EnableVersioning -eq $TRUE) 28 | { 29 | Write-host "The version settings is enabled for" $DocLibName -ForegroundColor Cyan 30 | Write-host "Start Exporting process ......." -ForegroundColor green 31 | 32 | #Prepare the file Path 33 | $ReportFolderPath = "C:\SPVersions\$DocLibName\LibVersions-$((Get-Date).ToString('yyyy-MM-dd-hh-mm-ss-tt'))" 34 | New-Item -ItemType Directory -Path $ReportFolderPath 35 | $ReportFilePath = "$ReportFolderPath\versions.csv" 36 | New-Item -ItemType file -Path $ReportFilePath 37 | 38 | 39 | #check the Report path 40 | if(Test-path $ReportFilePath) 41 | { 42 | #################################################################### 43 | 44 | #Check if the doc lib is found 45 | 46 | if($DocLib -ne $null) 47 | { 48 | #Get all documents 49 | $DocsCollection = $DocLib.Items 50 | if($DocsCollection -ne $null) 51 | { 52 | #iterate for each doc in document library 53 | foreach ($Doc in $DocsCollection) 54 | { 55 | $Vcount = ($Doc.Versions).Count #Get the Version Count 56 | $totalVersions=$Vcount #Total Versions 57 | $count= $Vcount #Set the decremental count to the Version Count 58 | #Iterate for each version in each document 59 | Add-Content -Path $ReportFilePath -Value "Doc ID,Document Name,Created By, Created Date, Modified By, Modified Date ,Size (KB)" 60 | Add-Content -Path $ReportFilePath -Value "$($Doc.id),$($Doc.Name),$($Doc['Author']),$($Doc['Created']),$($Doc['Editor']),$($Doc['Modified']),$($Doc.File.Length)" 61 | Add-Content -Path $ReportFilePath -Value "Version ID,Version Title, Modified By, Modified at ,Size (KB), CheckInComments" 62 | foreach($version in $Doc.Versions) 63 | { 64 | if([int]$count -eq $Vcount) 65 | { 66 | $VersionDetails = "$($version.VersionLabel),$($version['Title']), $($version.CreatedBy.User.DisplayName), $($version.Created),$($Doc.File.Versions.GetVersionFromLabel($version.VersionLabel).Size),$($version['Check In Comment'])" 67 | } 68 | else 69 | { 70 | $VersionDetails = "$($version.VersionLabel),$($version['Title']), $($version.CreatedBy.User.DisplayName), $($version.Created),$($Doc.File.Versions.GetVersionFromLabel($version.VersionLabel).Size),$($Doc.File.Versions.GetVersionFromLabel($version.VersionLabel).CheckInComment)" 71 | } 72 | # add the version details to the exported file 73 | Add-Content -Path $ReportFilePath -Value $VersionDetails 74 | $count = $count -1 #decrease version count 75 | } 76 | #Add Item Sperator 77 | Add-Content -Path $ReportFilePath -Value "---------------------------------------------------" 78 | $totalVersion = $totalVersion + $Vcount 79 | } 80 | 81 | Write-host "The versions of " $DocLibName " have been exported successfuly at " $ReportFilePath -ForegroundColor Green 82 | start $ReportFilePath 83 | Write-host "------------------------------------------------------" -ForegroundColor Cyan 84 | Write-host "Export Operation Summary" 85 | Write-host "------------------------------------------------------" -ForegroundColor Cyan 86 | Write-host "Site URL:" $siteURL -ForegroundColor Cyan 87 | Write-host "Site Title:" $WebSite -ForegroundColor Cyan 88 | Write-host "Document Library Name:" $DocLib -ForegroundColor Cyan 89 | Write-host "Number of Documents:" $DocsCollection.Count -ForegroundColor Cyan 90 | Write-host "Number of Versions:" $totalVersion -ForegroundColor Cyan 91 | } 92 | else 93 | { 94 | Write-host "No Documents in " $DocLibName -ForegroundColor Red 95 | } 96 | } 97 | else 98 | { 99 | Write-host "The " $DocLibName " is not found" -ForegroundColor Red 100 | } 101 | } 102 | else 103 | { 104 | Write-host $ReportFilePath "is not found" -ForegroundColor Red 105 | } 106 | 107 | } 108 | else 109 | { 110 | Write-host "The version settings is not enabled, please enabel it first" -ForegroundColor Red 111 | [system.Diagnostics.Process]::Start("iexplore","https://debug.to") 112 | } 113 | 114 | } 115 | catch 116 | { 117 | Write-host $_.Exception.Message -ForegroundColor Red 118 | } 119 | 120 | } 121 | 122 | 123 | # Provide the SharePoint Site URL, and the Document Library Name 124 | ExportDocLibVersions -siteURL "http://epm:19812/pmo/" -DocLibName "Doc Lib Get Versions Details" 125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /Get All Site Collections and SubSites Per Farm/SharePoint Site Collection Scan Report.ps1: -------------------------------------------------------------------------------- 1 | ####################################################### 2 | #Author: Mohamed El-Qassas 3 | #About Author: https://devoworx.com 4 | #Script Name: SharePoint Farm Statistics Scan Report 5 | #Script Description: list all details for Site Collection, and SubSites 6 | #Check the details at: https://spgeeks.devoworx.com/all-site-collections-and-subsites-per-farm 7 | #Check the Full Script details at: https://spgeeks.devoworx.com/sharepoint-farm-scan-report/ 8 | #Have a Question: Ask it at https://debug.to 9 | ####################################################### 10 | #Add Add-PSSnapin Microsoft.SharePoint.PowerShell 11 | Set-ExecutionPolicy "Unrestricted" 12 | Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction Stop 13 | ####################################################### 14 | function SPSiteScanReport() 15 | { 16 | 17 | Try 18 | { 19 | Write-Host "SharePoint Site Collection Scan Report" -ForegroundColor cyan 20 | Write-Host "--------------------------------------------------------------------" 21 | $ex = "Exceed the Supported Limit" 22 | $wa = "Within the Limit" 23 | #SharePoint Web Application 24 | $SPWebApp = Get-SPWebApplication 25 | $SPWebAppcount = $SPWebApp.count 26 | # Site Collections 27 | $SiteCollections = Get-SPSite | select url,contentdatabase,webapplication,@{Name="Site Collection Size (MB)";Expression={[math]::Round($_.usage.storage/(1MB),2)}},@{Name="Within the Limit"; Expression={if([math]::Round($_.usage.storage/1MB,2) -ge 100*1024){ "No"} else {"Yes"}}} | Format-List 28 | $SiteCollectionscount = (Get-SPSite).count 29 | # SubSites 30 | $Subsites = Get-SPSite | Get-SPWeb -Limit All 31 | $Subsitescount= $Subsites.count 32 | 33 | 34 | ################################################################################## 35 | #How Many SharePoint Site Collections Per farm 36 | Write-Host "SharePoint Site Collections Per farm" -ForegroundColor cyan 37 | Write-Host "The supported limit for SharePoint Site Collections per farm is 750,000 site collections." 38 | switch($SiteCollectionscount) 39 | { 40 | {$_ -ge 750000} {Write-Host "Total Number of SharePoint Site Collections:" $_ "|"$ex -ForegroundColor red } 41 | {$_ -lt 750000} {Write-Host "Total Number of SharePoint Site Collections:" $_ "|"$wa -ForegroundColor yellow} 42 | } 43 | $SiteCollections 44 | Write-Host "For more details, please check https://spgeeks.devoworx.com/sharepoint-2019-limitations" -ForegroundColor cyan 45 | Write-Host "--------------------------------------------------------------------" 46 | 47 | 48 | ################################################################################## 49 | #How Many SharePoint Site Collection Per Web Application 50 | Write-Host "SharePoint Site Collection Per Web Application" -ForegroundColor cyan 51 | foreach($WebApp in $SPWebApp){ 52 | Write-Host "The Total Number of site collection per Web Application" $WebApp.Url "is" (Get-SPSite -WebApplication $WebApp).count -ForegroundColor green 53 | Get-SPSite -WebApplication $WebApp | select url,contentdatabase,@{Name="Site Collection Size (MB)";Expression={[math]::Round($_.usage.storage/(1MB),2)}},@{Name="Within the Limit"; Expression={if([math]::Round($_.usage.storage/1MB,2) -ge 100*1024){ "No"} else {"Yes"}}} | format-list 54 | Write-Host "---------------------------------" 55 | } 56 | 57 | ################################################################################## 58 | #How Many SharePoint Site Collection Per Content Database 59 | Write-Host "SharePoint Site Collection Per Content Database" -ForegroundColor cyan 60 | foreach($cDB in Get-SPContentDatabase){ 61 | Write-Host "The Total Number of site collection per content database" $cDB.name "is" (Get-SPSite -ContentDatabase $cDB).count -ForegroundColor green 62 | Get-SPSite -ContentDatabase $cDB | select url,@{Name="Site Collection Size (MB)";Expression={[math]::Round($_.usage.storage/(1MB),2)}},@{Name="Within the Limit"; Expression={if([math]::Round($_.usage.storage/1MB,2) -ge 100*1024){ "No"} else {"Yes"}}} | format-list | format-list 63 | Write-Host "---------------------------------" 64 | } 65 | 66 | 67 | ################################################################################## 68 | #How Many SharePoint SubSites Per farm 69 | Write-Host "SharePoint SubSites Per farm" -ForegroundColor cyan 70 | Write-Host "The supported limit for subsites per farm is 250,000 subsites" 71 | switch($Subsitescount) 72 | { 73 | {$_ -ge 250000} {Write-Host "Total Number of SharePoint SubSites:" $_ "|"$ex -ForegroundColor red } 74 | {$_ -lt 250000} {Write-Host "Total Number of SharePoint SubSites:" $_ "|"$wa -ForegroundColor yellow} 75 | } 76 | $Subsites 77 | Write-Host "For more details, please check https://spgeeks.devoworx.com/sharepoint-2019-limitations" -ForegroundColor cyan 78 | Write-Host "--------------------------------------------------------------------" 79 | 80 | ################################################################################## 81 | #How Many SharePoint SubSites per Site Collection 82 | Write-Host "SharePoint SubSites per Site Collection" -ForegroundColor cyan 83 | foreach($SC in Get-SPSite){ 84 | Write-Host "The Total Number of SubSites per Site Collection" $SC.Url "is" (Get-SPWeb -Site $SC -Limit All).count -ForegroundColor green 85 | Get-SPWeb -Site $SC -Limit All | select url | format-list 86 | Write-Host "---------------------------------" 87 | } 88 | 89 | ################################################################################## 90 | #Site Collection Scan Report Summary 91 | Write-Host "Site Collection Scan Report Summary" -ForegroundColor Green 92 | Write-Host "Total Number of SharePoint Web Application Per Farm:" $SPWebAppcount 93 | Write-Host "Total Number of SharePoint Site Collection Per Farm:" $SiteCollectionscount 94 | Write-Host "Total Number of SharePoint SubSites Per Farm:" $Subsitescount 95 | Write-Host "Check the details at: https://spgeeks.devoworx.com/all-site-collections-and-subsites-per-farm" -ForegroundColor cyan 96 | Write-Host "For more details, please check https://spgeeks.devoworx.com/sharepoint-farm-scan-report/" -ForegroundColor cyan 97 | Write-Host "--------------------------------------------------------------------" 98 | } 99 | Catch 100 | { 101 | Write-Host $_.Exception.Message -ForegroundColor Red 102 | } 103 | } 104 | 105 | #Run SharePoint Site Collection Scan Report 106 | SPSiteScanReport -------------------------------------------------------------------------------- /SharePoint Farm Scan Report/SharePoint Farm Scan Report.ps1: -------------------------------------------------------------------------------- 1 | ####################################################### 2 | #Author: Mohamed El-Qassas 3 | #About Author: https://devoworx.com 4 | #Script Name: SharePoint Farm Statistics Scan Report 5 | #Script Description: list all details for Web Application, Application Pool, Content Database, Site Collection, and SubSites 6 | #Check the details at: https://spgeeks.devoworx.com/sharepoint-farm-scan-report/ 7 | #Have a Question: Ask it at https://debug.to 8 | ####################################################### 9 | #Add Add-PSSnapin Microsoft.SharePoint.PowerShell 10 | Set-ExecutionPolicy "Unrestricted" 11 | Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction Stop 12 | ####################################################### 13 | function SPFramScanReport() 14 | { 15 | 16 | Try 17 | { 18 | Write-Host "SharePoint Farm Scan Report" -ForegroundColor cyan 19 | Write-Host "--------------------------------------------------------------------" 20 | $ex = "Exceed the Supported Limit" 21 | $wa = "Within the Limit" 22 | #SharePoint Web Application 23 | $SPWebApp = Get-SPWebApplication 24 | $SPWebAppcount = $SPWebApp.count 25 | #SharePoint Web Application Pool 26 | $SPWebAppPool = Get-SPWebApplication | select ApplicationPool -Unique 27 | #SharePoint Service Application Pool 28 | $SPSrvWebAppPool = Get-SPServiceApplicationPool | Select -Unique 29 | $SPAppPoolCount = $SPSrvWebAppPool.count + $SPWebAppPool.count 30 | #SharePoint Service Applications 31 | $SPSrvApp = Get-SPServiceApplication | select id,name 32 | $SPSrvAppcount= $SPSrvApp.count 33 | # Content Databases 34 | $ContentDB = Get-SPContentDatabase | select name,WebApplication,@{Name="Contenet Database Size (GB)"; Expression={[math]::Round($_.disksizerequired/1024MB,2)}},@{Name="Within the Limit"; Expression={if([math]::Round($_.disksizerequired/1024MB,2) -ge 200){ "No"} else {"Yes"}}} 35 | $ContentDBcount = $ContentDB.count 36 | # Site Collections 37 | $SiteCollections = Get-SPSite | select url,contentdatabase,webapplication,@{Name="Site Collection Size (MB)";Expression={[math]::Round($_.usage.storage/(1MB),2)}},@{Name="Within the Limit"; Expression={if([math]::Round($_.usage.storage/1MB,2) -ge 100*1024){ "No"} else {"Yes"}}} | Format-List 38 | $SiteCollectionscount = (Get-SPSite).count 39 | # SubSites 40 | $Subsites = Get-SPSite | Get-SPWeb -Limit All 41 | $Subsitescount= $Subsites.count 42 | 43 | ################################################################################## 44 | #How Many Web Applications in farm 45 | Write-Host "SharePoint Web Applications per Farm" -ForegroundColor cyan 46 | Write-Host "The supported limit for the SharePoint web application per farm is 20 web applications." 47 | switch($SPWebAppcount) 48 | { 49 | {$_ -ge 20} {Write-Host "Total Number of SharePoint Web Application:" $_ "|"$ex -ForegroundColor red } 50 | {$_ -lt 20} {Write-Host "Total Number of SharePoint Web Application:" $_ "|"$wa -ForegroundColor yellow} 51 | } 52 | $SPWebApp 53 | Write-Host "For more details, please check https://spgeeks.devoworx.com/sharepoint-2019-limitations" -ForegroundColor cyan 54 | Write-Host "--------------------------------------------------------------------" 55 | 56 | 57 | ################################################################################## 58 | #How Many SharePoint Web Application Pools for the web server Per farm 59 | Write-Host "SharePoint Web Application Pools for the web server Per farm" -ForegroundColor cyan 60 | Write-Host "SharePoint Application Pool Limits for Web Server per Farm is 10 Application Pools (This limit depends mainly on the Server Hardware specifications)." 61 | switch($SPAppPoolCount) 62 | { 63 | {$_ -ge 10} {Write-Host "Total Number of SharePoint Application Pool:" $_ "|"$ex -ForegroundColor red } 64 | {$_ -lt 10} {Write-Host "Total Number of SharePoint Application Pool:" $_ "|"$wa -ForegroundColor yellow} 65 | } 66 | $SPWebAppPool 67 | $SPSrvWebAppPool | select name 68 | Write-Host "For more details, please check https://spgeeks.devoworx.com/sharepoint-2019-service-accounts-best-practice/" -ForegroundColor cyan 69 | Write-Host "--------------------------------------------------------------------" 70 | 71 | 72 | ################################################################################## 73 | #How Many SharePoint Service Applications Running on farm 74 | Write-Host "Running SharePoint Service Applications" -ForegroundColor cyan 75 | Write-Host "Total Number of Running SharePoint Service Applications:" $SPSrvApp.count -ForegroundColor Green 76 | $SPSrvApp 77 | Write-Host "--------------------------------------------------------------------" 78 | 79 | 80 | ################################################################################## 81 | #How Many SharePoint Content Database Per farm 82 | Write-Host "SharePoint Content Database Per farm" -ForegroundColor cyan 83 | Write-Host "The supported limit for SharePoint Content Databases per farm is 500 content databases." 84 | switch($ContentDBcount) 85 | { 86 | {$_ -ge 500} {Write-Host "Total Number of SharePoint Content Database:" $_ "|"$ex -ForegroundColor red } 87 | {$_ -lt 500} {Write-Host "Total Number of SharePoint Content Database:" $_ "|"$wa -ForegroundColor yellow} 88 | } 89 | $ContentDB 90 | Write-Host "For more details, please check https://spgeeks.devoworx.com/sql-server-best-practices-sharepoint/" -ForegroundColor cyan 91 | Write-Host "--------------------------------------------------------------------" 92 | 93 | 94 | ################################################################################## 95 | #How Many SharePoint Content Database Per Web Application 96 | Write-Host "SharePoint Content Database Per Web Application" -ForegroundColor cyan 97 | foreach($WebApp in $SPWebApp){ 98 | Write-Host "The Total Number of Content Database per Web Application" $WebApp.Url "is" (Get-SPContentDatabase -WebApplication $WebApp).count -ForegroundColor green 99 | Get-SPContentDatabase -WebApplication $WebApp | select name,@{Name="Contenet Database Size (GB)"; Expression={[math]::Round($_.disksizerequired/1024MB,2)}},@{Name="Within the Limit"; Expression={if([math]::Round($_.disksizerequired/1024MB,2) -ge 200){ "No"} else {"Yes"}}} | format-list 100 | Write-Host "---------------------------------" 101 | } 102 | 103 | ################################################################################## 104 | #How Many SharePoint Site Collections Per farm 105 | Write-Host "SharePoint Site Collections Per farm" -ForegroundColor cyan 106 | Write-Host "The supported limit for SharePoint Site Collections per farm is 750,000 site collections." 107 | switch($SiteCollectionscount) 108 | { 109 | {$_ -ge 750000} {Write-Host "Total Number of SharePoint Site Collections:" $_ "|"$ex -ForegroundColor red } 110 | {$_ -lt 750000} {Write-Host "Total Number of SharePoint Site Collections:" $_ "|"$wa -ForegroundColor yellow} 111 | } 112 | $SiteCollections 113 | Write-Host "For more details, please check https://spgeeks.devoworx.com/sharepoint-2019-limitations" -ForegroundColor cyan 114 | Write-Host "--------------------------------------------------------------------" 115 | 116 | 117 | ################################################################################## 118 | #How Many SharePoint Site Collection Per Web Application 119 | Write-Host "SharePoint Site Collection Per Web Application" -ForegroundColor cyan 120 | foreach($WebApp in $SPWebApp){ 121 | Write-Host "The Total Number of site collection per Web Application" $WebApp.Url "is" (Get-SPSite -WebApplication $WebApp).count -ForegroundColor green 122 | Get-SPSite -WebApplication $WebApp | select url,contentdatabase,@{Name="Site Collection Size (MB)";Expression={[math]::Round($_.usage.storage/(1MB),2)}},@{Name="Within the Limit"; Expression={if([math]::Round($_.usage.storage/1MB,2) -ge 100*1024){ "No"} else {"Yes"}}} | format-list 123 | Write-Host "---------------------------------" 124 | } 125 | 126 | ################################################################################## 127 | #How Many SharePoint Site Collection Per Content Database 128 | Write-Host "SharePoint Site Collection Per Content Database" -ForegroundColor cyan 129 | foreach($cDB in Get-SPContentDatabase){ 130 | Write-Host "The Total Number of site collection per content database" $cDB.name "is" (Get-SPSite -ContentDatabase $cDB).count -ForegroundColor green 131 | Get-SPSite -ContentDatabase $cDB | select url,@{Name="Site Collection Size (MB)";Expression={[math]::Round($_.usage.storage/(1MB),2)}},@{Name="Within the Limit"; Expression={if([math]::Round($_.usage.storage/1MB,2) -ge 100*1024){ "No"} else {"Yes"}}} | format-list | format-list 132 | Write-Host "---------------------------------" 133 | } 134 | 135 | 136 | ################################################################################## 137 | #How Many SharePoint SubSites Per farm 138 | Write-Host "SharePoint SubSites Per farm" -ForegroundColor cyan 139 | Write-Host "The supported limit for subsites per farm is 250,000 subsites" 140 | switch($Subsitescount) 141 | { 142 | {$_ -ge 250000} {Write-Host "Total Number of SharePoint SubSites:" $_ "|"$ex -ForegroundColor red } 143 | {$_ -lt 250000} {Write-Host "Total Number of SharePoint SubSites:" $_ "|"$wa -ForegroundColor yellow} 144 | } 145 | $Subsites 146 | Write-Host "For more details, please check https://spgeeks.devoworx.com/sharepoint-2019-limitations" -ForegroundColor cyan 147 | Write-Host "--------------------------------------------------------------------" 148 | 149 | ################################################################################## 150 | #How Many SharePoint SubSites per Site Collection 151 | Write-Host "SharePoint SubSites per Site Collection" -ForegroundColor cyan 152 | foreach($SC in Get-SPSite){ 153 | Write-Host "The Total Number of SubSites per Site Collection" $SC.Url "is" (Get-SPWeb -Site $SC -Limit All).count -ForegroundColor green 154 | Get-SPWeb -Site $SC -Limit All | select url | format-list 155 | Write-Host "---------------------------------" 156 | } 157 | 158 | ################################################################################## 159 | #Farm Summary 160 | Write-Host "Farm Report Summary" -ForegroundColor Green 161 | Write-Host "Total Number of SharePoint Web Application Per Farm:" $SPWebAppcount 162 | Write-Host "Total Number of SharePoint Application Pool Per Farm:" $SPAppPoolCount 163 | Write-Host "Total Number of SharePoint Service Application Per Farm:" $SPSrvAppcount 164 | Write-Host "Total Number of SharePoint Content Database Per Farm:" $ContentDBcount 165 | Write-Host "Total Number of SharePoint Site Collection Per Farm:" $SiteCollectionscount 166 | Write-Host "Total Number of SharePoint SubSites Per Farm:" $Subsitescount 167 | Write-Host "For more details, please check https://spgeeks.devoworx.com/sharepoint-farm-scan-report/" -ForegroundColor cyan 168 | Write-Host "--------------------------------------------------------------------" 169 | } 170 | Catch 171 | { 172 | Write-Host $_.Exception.Message -ForegroundColor Red 173 | } 174 | } 175 | 176 | #Run the SharePoint Farm Scan Report 177 | SPFramScanReport --------------------------------------------------------------------------------