Get list of Site Collection Admins (SCA) using PowerShell

Requirement Generate a list of SCAs across all your SharePoint site collections. Solution function Get-SCA { param($site) $link = $site+"/_layouts/mngsiteadmin.aspx"   $result = Invoke-WebRequest $link -UseDefaultCredentials   $value = $result.AllElements | Where id -eq "ctl00_PlaceHolderMain_ctl00_PeopleEditorAdmins_OriginalEntities" | Select value $value = $value.value.split(">") | where { $_ -match "displaytext" } $value = $value.split("`"") | where { $_ […]

Continue Reading...

Automatically download versions of a file in SharePoint to your computer

Requirement Download all versions of a file in SharePoint to a local folder on your computer. Solution Use the PowerShell script below to do this. You can run this script as a normal user as long as you have access to the GetVersions webservice method. Usage: Run the script in PowerShell or PowerShell ISE. Parameters: […]

Continue Reading...

User PowerShell to compare whether two arrays are exactly the same

Requirement Compare two arrays in PowerShell to determine if both are exactly this same. This code was used in my script to find document libraries that inherited permissions from the site level. ¬†With a server side script, you could do this easily with the HasUniqueRoleAssignments property. Not so easy when using SharePoint Web Service. Solution […]

Continue Reading...

PowerShell script to generate report on all documents in Site Collection (Client side)

Requirement Generate a report for all documents in a site collection (including metadata) without having access to the SharePoint Management Shell or any third party add-on. Solution This script uses the SharePoint client side object model and SharePoint Web services. You will need to run it on an account with Site Collection Administrator access. This […]

Continue Reading...

Microsoft SharePoint is not supported with version 4.0.30319.296 of the Microsoft .Net Runtime.

Problem You try to configure SharePoint Diagnostic Studio for SharePoint 2010 and get the following error: Microsoft SharePoint is not supported with version 4.0.30319.296 of the Microsoft .Net Runtime. Solution This occurs when you have Microsoft Windows Management Framework 3.0 (KB2506143) installed on your SharePoint server. Note that if you installed this update, SharePoint 2010 […]

Continue Reading...