Tag Info

Hot answers tagged

5

$web = Get-SPWeb -Identity http://sp2010 $list = $web.Lists["Documents"] $items = $list.Items foreach ($item in $items) { $file = $item.File $fileVersions = $file.Versions if ($fileVersions.Count -gt 0) { $fileVersions.Restore($fileVersions.Count - 1) } } UPDATE Please note that when any of ...


3

You can use also 3-rd party tool to move documents with their versions - e.x. SharePoint Copy & Move Files. Althought this is paid version, it has 30 days trial, so you can test everything.


3

I know this is not quite an answer you may be looking for, but why not rename doc2.pdf to doc1.pdf and then rename it in SharePoint itself?


2

Sean It is possible to do this however you will need a workflow to run behind the scenes to create a sneaky URL with some specific elements in it to show the latest Published version of any document - i.e. the Major release. Basically the way SharePoint manages previous version of documents is in using a set of hidden folders of all the previous ...


2

A powershell can be written to copy files with a system update to retain the modified by and modified columns, refer link Second, check with your admin if they use any tool to move objects between environments (the one we have is Metalogix, we use for purposes like this).


2

As mentioned here: Introduction to versioning. By default, each major version can have up to 511 drafts (minor versions) This should still hold true for SharePoint 2013.


1

Assuming that you have only major versions enabled in document library. SharePoint's default behavior is the same when you are getting the version number in REST query. The checked in version is: 6.0 After checking out it became 7.0 version. However, if you want to display the last checked in version of the file you can get that idea from ...


1

After you get the list, enable versioning. Then load the list and call execute query async


1

Unfortunately only SharePoint Online CSOM API (v.16) supports those properties currently for List object: List.MajorWithMinorVersionsLimit List.MajorVersionLimit In SharePoint On Premise, you could consider the following approach to return those properties: getListInfo('Documents', function (info) { console.log(info.MajorVersionLimit); ...


1

You can access this information via the MajorVersionLimit and MajorWithMinorVersionsLimit properties of the Microsoft.SharePoint.Client.List object. For example (managed OM): string url = "http://yoursite/subweb"; using (var clientContext = new ClientContext(url)) { var web = clientContext.Web; List list = web.Lists.GetByTitle("YourDocLib"); ...


1

You should remove the previous content type before deploying the latest one. In some cases the removal will fail because its being using in the Site. The best practice in such situation is to use another feature with a receiver, the receiver is the one which make the updates (in your case adding a new site column) More details on this topic ...


1

The SharePoint SQL Schema details are not documented. Its not documented because Microsoft don't want any one to touch it. There are complex job's etc running on these tables and a simple read operation can bring down the farm. SharePoint comes with various API to access the data.


1

You can use just a small trick as mentioned below. Sample Code : foreach (SPListItem item in list.Items) { foreach (SPListItemVersion itemVersion in item.Versions) { if (item.File.Versions.GetVersionFromLabel(itemVersion.VersionLabel) != null) { ...


1

You can split the version label and check is the second part 0 string[] versionArray = itemVersion .VersionLabel.Split('.'); int minorVersion = Convert.ToInt32(versionArray[1]); if (minorVersion == 0) { //this is a major version } or you can check the reminder when dividing VersionId with 512 int modulo = itemVersion.VersionId % 512; if (modulo == 0) ...


1

You cannot change item version properties as SPListItemVersion.this[string] indexer is read only. That is, whereas this code is legal: SPListItem item = list.GetItemById(1); item["X"] = "a"; The below code will throw error: Property or indexer 'Microsoft.SharePoint.SPListItemVersion.this[string]' cannot be assigned to -- it is read only ...


1

You can't, this is an all or nothing setting. It is either content approval for everyone, or no one.


1

a. Create a new Permission Level copied from "Read" permission b. Remove "View Versions" option from the new permission level c. Set that new permission level to the users or groups Following are the steps... Go to the Site Collection > Top level Site > Site Settings > Site Permissions Click on "Permission Levels" from Ribbon > Permission Tools > Manage ...


1

It depends. If you have version control enabled - and you have saved at least once, then you can access that version from the version menu and restore it. If you are not using version control - then the answer is no, you can not "undo" the undo. The changes are unfortunately lost.


1

I found a solution here, it involves editing the Checkin.aspx page. This would affect every site collection in the farm, unless you wrap it in a feature. Open Windows Explorer to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS. Locate the file "checkin.aspx" and make a copy in case there is a problem. Open ...


1

When working with SharePoint remotely, you have to use CSOM and the CSOM model, you can't use any Microsoft.SharePoint.* objects. Everything is Microsoft.SharePoint.Client.*. Start here to get acquainted with CSOM: http://msdn.microsoft.com/en-us/library/ff798388.aspx


1

Read permission grants a user "View Version" base permission by default. If you have minor & major version turned on in a library, you can limit who can view the minor versions in the version history (readers, contributors, approvers) in List -> Settings -> Version Settings -> Draft Item Security.


1

Read permissions allow users to view past version history of list items. You can look at your permissions levels by going to Site Actions->Site Settings->Site Permissions, then click on Permissions Levels in the ribbon. I would suggest getting familiar with these permissions and perhaps creating your own to do what you want. Even Read permissions might ...


1

So now I feel really stupid. I went and look at the workflow and saw that I could select "Start this workflow to approve publishing a major version of an item." and of course that works perfectly.


1

I know it's been 3 years ago and already answered, but here you can find plenty of versioning scripts and ready programs: Disable a versioning on Image Libraries in SharePoint using PowerShell Enable versioning for all SharePoint Online lists using Powershell Enable versioning for all lists in SharePoint Online tenant (C#) Restore and clean up SharePoint ...


1

Here is the answer for Excel. A similar solution should work for Visio. Create a new column in your library called "SPVersion". Use SharePoint Designer to create a workflow that copies the file version ("Current Item" "Version") to your SPVersion column. In Excel, add the following VBA code to the ThisWorkbook module: Private Sub ...



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