Before decommissioning a Sharepoint server, I needed a list of all users on the different team sites. Time for some Powershell magic! On the Technet site I found a script that promised to do exactly what I needed: This script enumerates SharePoint 2010 or 2013 permissions across the entire farm down to the site (SPWeb) level. It also recursively expands the membership of any AD group and lists the assignment role binding on the permission. The output is an XML format . So I copied the script over, logged in on the Sharepoint server and opened up a Powershell command prompt. However when I tried to execute the script it failed with the following error message: Exception has been thrown by the target of an invocation + CategoryInfo : NotSpecified: (:) [], TargetInvocationExcept + FullyQualifiedErrorId : System.Reflection.TargetInvocationException So I opened up the script to find the root cause of the error and saw that it failed on the call to AllWebs : On...