Get Site Collection properties using PowerShell – SharePoint 2013

Today I am just going to blog about how to get certain information about site collections to which SharePoint Administrators might not have access to. This question comes up quite often on SharePoint forums.

If you are looking to get information for the site collection or want to generate report on site collection properties then your best friend is Get-SPSiteAdministration cmdlet. This cmdlet contains more than one parameter set. You may only use parameters from one parameter set, and you may not combine parameters from different parameter sets.

If you want to learn how to use parameters sets then follow the link below.

https://msdn.microsoft.com/library/dd878348(VS.85).aspx

For example if you would like to list primary site collection administrator and secondary site collection administrator then you would use something like,

Get-SPSiteAdministration -identity SITECOLLECTIONURL -Limit ALL | Select -Property OwnerDisplayName, SecondaryContactDisplayName

Here is the list of all the properties that you can get using this cmdlet.

https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spsiteadministration_properties.aspx

Similar to this there is Set-SPSiteAdministration cmdlet which can be used to set different properties for the site collections.

Cannot find s4-ribbonrow in oslo master page

Today’s post is quick how to when working with SharePoint Online Master page.

When working with SharePoint Online oslo master page, you will find that usual way of hiding gear icon would not work i.e. you will not find the div for s4-ribbonrow. Seattle.master still has that.

Reason for that is because Oslo and Seattle are different master page. You can read about the difference in the following blog post.

There’s more than meets the eye: Differences between SharePoint’s Oslo and Seattle master pages

Coming back to hiding the gear icon you can target the button ID to hide it.

Either in your CSS or Script Editor web part add the following Style.

<style>#O365_MainLink_Settings{ display:none;}</style>

Where O365_MainLink_Settings is the ID of Settings button.

I hope this helps someone.