Manage Security

SharePoint would not be where it is in the marketplace if it didn't have a mechanism for implementing security. Security is implemented at many different levels, with the most obvious being at the Site level. Whether we are talking about Site Collections or sub-Sites, security for each of these objects is exactly the same. In fact, to access the security settings for your Site Collection programmatically, you will need to access the RootWeb property of the SPSite object. The RootWeb property simply returns back an SPWeb object corresponding to the Site at the root of the Site Collection.

In Listing 8.1, we are outputting all the relevant properties associated with the root SPWeb object. We have removed unrelated properties from ...

Get Automating Microsoft® SharePoint® 2010 Administration with Windows PowerShell® 2.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.