Hot answers tagged

29

Although in most of the UI and API they can be manipulated the same way, there are some significant differences between Lists and Libraries. The latter is a specialized type of the former. Lists: Can have attachments Have major versions only Do not have Check-in/Check-out features Libraries: Cannot have attachments (files are directly in the library) ...


11

A library is "just" a special type of list where the focus is on the File linked to the listitem Anything you can do with a list you can do with a library and then some


9

The code loops through entire site and gives the size of all document libraries. [System.reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint”) [System.Reflection.Assembly]::Load(“Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c”) [System.Reflection.Assembly]::Load(“Microsoft.SharePoint.Portal, ...


7

The default setting for SharePoint 2013 is two days, which you can check using this script: $WebApp = Get-SPWebApplication http://portal $WebApp.DaysToShowNewIndicator 2 You can change the number of days the same way: $WebApp.DaysToShowNewIndicator = 5 $WebApp.DaysToShowNewIndicator 5 Reference: NEW INDICATOR IN SHAREPOINT LISTS AND LIBRARIES – NUMBER ...


6

I created this simple PowerShell script to calculate for a single Document Library what the size in MB is for all the files inside: $total = $null; ((get-spweb http://WebApplication/SiteCollection/subsite/).lists | Where-Object {$_.title -eq "Library Title"}).items | foreach {$total+= $_.file.length}; $total /1MB Before you can use the script you need to ...


6

Out of the box, this isn’t possible. You can, however, restrict both download and printing with Information Rights Management for all users, but not for a group of users. And since there is a snipping tool and a print screen function on all operating systems, users can with a little effort still get the content of document and save it somewhere else. So this ...


5

Great Info! In an attempt to make a more exhaustive comparison (because none exist!) here are a couple of things left out: List list attachments are not indexed. This has a lot of implications. When searching, you cannot use the refiners to narrow down the doc type List attachments will not work with the eDiscovery feature No location based default column ...


5

You can't push the file to the client from the server. The server side has no knowledge of the client side. You have to write a client application, that will pull the file. First, you'll have to know the url of the file. Then, a simple var wc = new WebClient(); wc.UseDefaultCredentials = true; wc.DownloadFile(targetFile, @"c:\temp\myfile.txt"); would ...


5

You only see the last error because Set-Content overwrites the existing content, use Add-Content instead. If you want to have a more encompassing approach, like Robert suggested, there's a more PowerShell'y (?) way of doing this with Start/Stop-Transcript which takes all console output between the Start & Stop cmdlet calls and outputs it to a file.


5

Why not open the site in IE, open the library using "Open in Explorer Mode" from the ribbon, select all, right click and choose Properties, that should give you the actual size.


5

Those groups will not be able to access the folders if the permission for the folder is broken and only the group "XYZ" has permissions to the folder and rest all are removed. UPDATE Sample powershell code: $folders = $list.Folders foreach ($spFolder in $folders) { $PermissionLevel = "PermissionName" ; $group = $web.SiteGroups[$GroupName]; ...


5

Your example contains the following errors/typos: To get fs object type use the following syntax: var fsObjType = selectedItem.get_fileSystemObjectType(); Another point is, ListItem object have to be requested first before getting it's value, this is why in your example it will not work. In fact, you don't have to request ListItem object in order ...


5

This is a file that's located on the server's file system. Microsoft definitely doesn't recommend changing this file for the following reasons: Having multiple web front ends means you will have to change the page layout on each of these servers. If the different servers are using different files on their file system, different users will get different ...


5

Lookup columns can only be based on 'Single line of text', 'Number' or 'Date and time' columns see Create list relationships by using unique and lookup columns So your only option would be to create a 'Single line of text' column and have an event receiver or workflow populate this with the wanted information from the person in the owner field.


4

Its because the Home.aspx (may be another page in your case) is set as a welcome page for the library root folder. Below should fix it $web = Get-SPWeb "http://site" $list = $web.Lists["Site Pages"] $rootfolder = $list.RootFolder $rootfolder.WelcomePage = "Forms/AllPages.aspx" $rootfolder.Update() Write-Host $list.RootFolder.WelcomePage $web.Dispose()


4

Simple answer: you can't. You are thinking of SharePoint as if it is a file system, which it is not. To organise content into "folders" you'd need to create subwebs and move libraries there. But the wiser thing to do would be to correctly assign content types and metadata to your documents, then use search to find what you need. I know this is a very ...


4

To create a Document library: New-SPList -Web http://spwebaddress -ListTitle “Enter Title Here” -ListUrl “ListURL” -Description “Description” -Template “Document Library” To upload to a folder within document library you should get the spfolder then add to it... $folder=$web.GetFolder(“FolderName″) $folder.Files.Add($folder.Url + “/” + $file.Name, [...


4

You could rely on Information Management Policies and setup a Retention policy to either archive, remove, etc (http://www.dynamics101.com/2013/03/sharepoint-information-management-policy/ or http://office.microsoft.com/en-001/sharepoint-server-help/create-and-apply-information-management-policies-HA101631505.aspx)


4

You need to retrieve SPWebApplication.DaysToShowNewIndicator and the build a query to retrieve documents created within that number of days. For more code see Getting the list of new items from code


4

Can't you just click the actual link instead?


4

A little JavaScript employing jQuery does the job just perfectly. $(document).ready( function () { // has to be on an interval for grouped doc libraries // where the actual links are loaded only once a group // is expanded setInterval( function () { $("a[onclick*='return DispEx'][target!='_blank']") .attr("...


3

Try this: $web = Get-SPWeb -Identity http://inside.site.be/Tools $list = $web.GetList("http://inside.site.be/Tools/site_candidate/") $folderquery = New-Object Microsoft.SharePoint.SPQuery $foldercamlQuery = '<Where> <Eq> <FieldRef Name="ContentType" /> <Value Type="text">Folder</Value> </Eq&...


3

If your client code is running on server which means that request is being sent from server and your file will eventually downloaded on server. I would recommend you to write a code which runs on your computer and download the file from Server. You can Lists.asmx or OOTB Web Service to download the file from the Server.


3

The simple approach would be to create a list in a site, define the fields you wish to keep track of (title, ISBN, abstract, etc). Then make sure that all of the people that you wish to be able to use the list have 'Contribute' permissions. If the library is self-managed then require checkout to modify an item. Then, the user can merely 'Check out' the ...


3

Edit the permission of the list and set the access level accordingly, you can even give permission to only a few user to a list or library. You can find list permission under list settings. I would recommend creating a group if you need this set of user in some other place also, otherwise if you know that you have to use this permission set only for a ...


3

The versioning in SharePoint is tracking Major (published with everyone, everything having 1.0, 2.0, etc.) and/or Minor (X.1, X.2, etc.). According to how you have setup Versioning via the List/Library Settings you would have Major or Major and Minor. In both cases when you limit versions, basically the OLDEST are deleted, so you would 0.1, 0.2, 0.3 as ...


3

you can create a new column to use as your filter say Sr# and assign the number to this column. Change the values according to the order, by which you want to display the items. Edit the view and Sort by this column name.


3

So, when you reference a dll created in a different project and reference it in your SP project, you need to add it to the Package. To make Visual Studio adding 3rd party assembly or even your own assembly from other project in solution to GAC please do next: Open Package.package from Package folder in SharePoint project. Click Advanced in bottom area. ...


3

$RootFolder.SubFolders will give you the collection of folders. Loop through the collection and use StartsWith with each folder: $folders = $RootFolder.SubFolders; foreach ($folder in $folders) { if ($folder.Name.StartsWith("a")) { // Call $folder.Subfolders again to get folders present in this folder // Then use foreach to loop ...


3

Use a Custom Action with Location="ScriptLink" and inject jQuery/JS on the fly, which hides or uncheck the button by default



Only top voted, non community-wiki answers of a minimum length are eligible