Wednesday, February 22, 2017

size of sitecollection

 $site = get-spsite sitecollection
 $site.Usage.Storage/1024/1024/1024

Thursday, February 16, 2017

Block files from uploading them in SharePoint

Goto Central Admin -> Security -> Define Blocked File types
and add the extension of the file type that you want blocked.
this needs to be done for each web application.

If you have multiple web applications, you can use following code

$wApps = Get-SpWebApplication
foreach ($wApp in $wApps) {
>> $Extensions = $wApp.BlockedFileExtensions
>> $Extensions.Add(".Msg")
>> $wApp.Update()
>> }