Skip to content

Instantly share code, notes, and snippets.

joerodgers

Block or report user

Report or block joerodgers

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@joerodgers
joerodgers / CustomSearchConfigurationMangagement.ps1
Last active Dec 11, 2019
Script to export and import search schema on SharePoint 2013+.
View CustomSearchConfigurationMangagement.ps1
Add-PSSnapin Microsoft.SharePoint.PowerShell
function Enable-SearchConfigurationFeature
{
[cmdletbinding()]
param
(
[Parameter(Mandatory=$true,ValueFromPipeline=$true)][Microsoft.SharePoint.SPWeb]$Web
)
@joerodgers
joerodgers / Get-RSAddInVersion.ps1
Created Dec 3, 2019
Queries all the servers in the farm and reports the name, version and installation date for 'Microsoft SQL Server 201x RS Addin for SharePoint'
View Get-RSAddInVersion.ps1
Add-PSSnapin -Name Microsoft.SharePoint.PowerShell
$servers = @(Get-SPServer | ? Role -ne "Invalid" | SELECT -ExpandProperty Name)
foreach( $server in $servers )
{
$products = @(Get-CimInstance -ClassName Win32_Product -ComputerName $server -Filter "Name like 'Microsoft SQL Server%RS Addin%'")
if( $products.Count -gt 0 )
{
@joerodgers
joerodgers / Get-PrincipalGroupMembership.ps1
Created Nov 25, 2019
Mimics the domain group lookup process used in SharePoint 2016's "Check Permissions" feature.
View Get-PrincipalGroupMembership.ps1
function Get-PrincipalGroupMembership
{
[CmdletBinding()]
param
(
[parameter(Mandatory=$true,ValueFromPipeline=$true)][string]$Login
)
begin
@joerodgers
joerodgers / Get-SandboxSolutionInstances.ps1
Created Nov 22, 2019
Reports sandbox solution references in the farm.
View Get-SandboxSolutionInstances.ps1
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue | Out-Null
$sites = Get-SPSite -Limit All | ? IsReadLocked -eq $false
$results = @()
foreach( $site in $sites )
{
$solutions = @($site | Get-SPUserSolution)
@joerodgers
joerodgers / Get-TotalItemsInContentDatabase.ps1
Created Nov 21, 2019
Gets the total item count of all items in a SharePoint 2013+ content database.
View Get-TotalItemsInContentDatabase.ps1
$sites = Get-SPSite -Limit All -ContentDatabase "SP2016_CONTENT_001"
$itemCounts = @()
foreach( $site in $sites )
{
$itemCount = 0
$lists = $site | Get-SPWeb -Limit All | SELECT -ExpandProperty Lists
@joerodgers
joerodgers / Get-WorkflowInstance.ps1
Last active Dec 4, 2019
Diagnostic tool for dumping out all Workflow Manager instances on lists in SharePoint 2013+
View Get-WorkflowInstance.ps1
Add-PSSnapin Microsoft.SharePoint.PowerShell
function Get-WorkflowInstance
{
[cmdletbinding()]
param
(
[Parameter(Mandatory=$true,ValueFromPipeline=$true)][Microsoft.SharePoint.SPWeb]$Web
)
@joerodgers
joerodgers / Download-Folder.ps1
Created Nov 19, 2019
Downloads all files in a SharePoint 2013+ SPFolder via HTTP web request. Optionally can recursively download all files in sub folders.
View Download-Folder.ps1
Add-PSSnapin Microsoft.Sharepoint.PowerShell
function Download-Folder
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true)][string]$SharePointFolderUrl,
[Parameter(Mandatory=$true)][string]$Path,
[Parameter(Mandatory=$false)][switch]$Recurse
@joerodgers
joerodgers / Get-FilesThatWillNotOpen.ps1
Created Nov 14, 2019
Tries to open all 6 byte files in a site collection and reports if the opening was successful or not.
View Get-FilesThatWillNotOpen.ps1
Add-PSSnapin -Name Microsoft.SharePoint.PowerShell
function Get-FilesThatWillNotOpen
{
[cmdletbinding()]
param
(
[parameter(Mandatory=$true)][Microsoft.SharePoint.SPSite]$Site
)
View debug1.ps1
$web = Get-SPWeb -Identity "https://sharepoint.2016.contoso.com/sites/teamsite"
$Library = $web.Lists.TryGetList("Documents")
$query = New-Object Microsoft.SharePoint.SPQuery
$query.ViewXml = "<View Scope='RecursiveAll'>
<Query>
<Where>
<Eq>
<FieldRef Name='FSObjType'/>
@joerodgers
joerodgers / GetAutoGrowthSettings.sql
Last active Nov 14, 2019
T-Shooting related SQL queries for SharePoint Databases
View GetAutoGrowthSettings.sql
SELECT
DB_NAME(mf.database_id) AS 'Database Name'
,mf.Name AS 'Database File Name'
,CONVERT(DECIMAL (20,2)
,CONVERT(DECIMAL, size)/128) AS 'Current File Size'
,CASE mf.is_percent_growth
WHEN 1 THEN 'Yes'
ELSE 'No'
END AS 'Is Percentage Growrth'
You can’t perform that action at this time.