Seeking SPSite and SPWeb Detailed Explanation

Good afternoon. I am using SharePoint 2013 in a hybrid environment. On the on-prem side, I need to develop a PowerShell script that creates a CSV file containing the following information for each site within a site collection:

1. Site URL
2. Name of entity (individual user, SharePoint Group or Active Directory Security Group) with access to site
3. Whether entity is an individual user, SharePoint Group or Active Directory Security Group
4. Level of access entity has to site
5. * Username, First Name, Middle Initial and Last Name of entity 

* If the entity is a SharePoint Group or AD Security Group, these fields will contain data associated with a member of that group. For example, if a SharePoint Group that has access to a particular site contains 3 users, the CSV file will include 3 rows - one for each member of the group. 

I developed a test script that uses Get-SPWeb to display users and groups that have been granted access to a site collection. I suspect that I will need to modify the script to pipe the Get-SPWeb result to a Get-SPSite cmdlet. However, I do not understand the architecture of SPSite or SPWeb objects well enough to do this.  I have reviewed https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsite.aspx and https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsite.aspx, but I'd like to review some background material that contains more details. Does anyone have any recommendations? Thank you.

July 17th, 2015 5:29pm

SPSite is a parent of SPWeb

You could use one of the pre-existing scripts that others have created to report on this stuff. This article shows you how to build your own up:

http://sharepointpromag.com/sharepoint-2013/exploring-sharepoint-users-groups-and-security-using-powershell

There are quite a few more around on places like the Script Gallery.

Free Windows Admin Tool Kit Click here and download it now
July 18th, 2015 3:31am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics