Missing “Destination folder” on upload document form

When uploading documents into a document library with folders, you normally see the following screen:

image

Problem
On one of our sites the Destination Folder was not available. After some investigating I found that the site where it didn’t work, was created using the “Blank site” template. After some research I found a similar issue on the net.

Solution
Since we used the “Blank site” template, some features do not get activated by default.

I found out that the feature that is responsible for the “Destination Folder” is the “Metadata Navigation and Filtering” feature.

image

After activating the solution, the Destination Folder became available. Note that if you turn this feature off, existing libraries will be able to select a destination folder, as where newly created document libraries will not be able to use this feature.

More information

For more information about the Metadata Navigation and Filtering in SharePoint Server 2010, check this article.

Thanks for reading!

Missing “Destination folder” on upload document form

When uploading documents into a document library with folders, you normally see the following screen:

image

Problem
On one of our sites the Destination Folder was not available. After some investigating I found that the site where it didn’t work, was created using the “Blank site” template. After some research I found a similar issue on the net.

Solution
Since we used the “Blank site” template, some features do not get activated by default.

I found out that the feature that is responsible for the “Destination Folder” is the “Metadata Navigation and Filtering” feature.

image

After activating the solution, the Destination Folder became available. Note that if you turn this feature off, existing libraries will be able to select a destination folder, as where newly created document libraries will not be able to use this feature.

More information

For more information about the Metadata Navigation and Filtering in SharePoint Server 2010, check this article.

Thanks for reading!

Get Site Collections per Content Database one-liner

This will be a very short post, as it contains only 1 line of PowerShell code, and is not very hard to understand. It shows you all content databases, and for each of the content databases, it will show you the site collections within this content database.

Get-SPContentDatabase | %{Write-Output "- $($_.Name)”; foreach($site in $_.sites){write-Output $site.url}}

That wasn’t so bad right? Just copy and paste this code into your SharePoint 2010 Management Shell (As administrator), and let PowerShell do your work for you!

image

Now let’s say you want to save this output to a .txt file, you can add “> C:\sitecollections.txt”.

The full command would be:

Get-SPContentDatabase | %{Write-Output "- $($_.Name)”; foreach($site in $_.sites){write-Output $site.url}} > C:\sitecollections.txt

This would create a .txt file with the same information:

image

That’s all there is to it!

Content Database size report using PowerShell – SharePoint 2010

What does it do?
The script will create a report of all Web Applications and the associated Content Databases.
It will tell you how big each Content Database is in GB. The result will be saved in a .txt file. Optionally, you can send this .txt as an attachment in an e-mail.

If you are using this script to mail the report, you might want to add a body to the e-mail, so you can make it look better, but this is not included with the current script.

How to use it
I designed the script so it is easy to schedule as a task. Before you go ahead and schedule it in the task scheduler, you have to add values to some optional and required parameters, For instance, if you want to e-mail this .txt file, you should add at least a SMTP Server, subject, the mail from address and the send to address.

The script

#Get SharePoint Content database sizes
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$date = Get-Date -Format "dd-MM-yyyy"

#Variables that you can change to fit your environment
$TXTFile = "D:\Reports\SPContentDatabase_$date.txt"
$SMTPServer = "yourmailserver"
$emailFrom = "SharePointReports@company.com"
$emailTo = "youradmin@company.com"
$subject = "Content Database size reports"
$emailBody = "Daily/Weekly/Monthly report on Content databases"

$webapps = Get-SPWebApplication
foreach($webapp in $webapps)
{
    $ContentDatabases = $webapp.ContentDatabases
    Add-Content -Path $TXTFile -Value "Content databases for $($webapp.url)"
    foreach($ContentDatabase in $ContentDatabases)
    {
    $ContentDatabaseSize = [Math]::Round(($ContentDatabase.disksizerequired/1GB),2)
    Add-Content -Path $TXTFile -Value "-     $($ContentDatabase.Name): $($ContentDatabaseSize)GB"
    }
}
if(!($SMTPServer) -OR !($emailFrom) -OR !($emailTo))
{
Write-Host "No e-mail being sent, if you do want to send an e-mail, please enter the values for the following variables: $SMTPServer, $emailFrom and $emailTo."
}
else
{
Send-MailMessage -SmtpServer $SMTPServer -From $emailFrom -To $emailTo -Subject $subject -Body $emailBody -Attachment $TXTFile
}

The result

image

Scheduling the script
Save the script (In my example: C:\Install\Get-SPContentDatabaseSize.ps1)
Start the Task scheduler: Start –> Run: taskschd.msc
Create a new task:

image

General
image

– Make sure the account running the task has sufficient permissions to access the databases
– “Run whether user is logged on or not” should be checked.
– Run with highest privileges has to be checked.

Triggers
image

The triggers can be set to your requirements, in this example I scheduled the task weekly at 6PM.

Actions
To run a PowerShell script as a scheduled task, you cannot simply add the C:\Install\Get-SPContentDatabaseSize.ps1 in the “Program/script” field.
You should do the following:
image
Program/script: %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe
Add arguments (optional): -Command C:\Install\Get-SPContentDatabaseSize.ps1

Click OK and enter the password for the account that is running the scheduled task, and VOILA.