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 ...


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

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

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

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

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 ...


1

For future reference: there's a legacy API used by SharePoint Designer, called FrontPage RPC, and there's a bunch of methods, including move document that accepts a put_option parameter with migrationsemantics flag to preserve the information about who created a document, who modified it, and when it was created, and this could be used from advanced workflow ...


1

I always employ the drag and drop method suggested by Tom. Easiest enough for my end users to do themselves and I still have the version history.


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

There are certain classes defined inside Microsoft.SharePoint namespace which you can use to customize your audit report. SPAudit SPAuditEntry SPAuditEventType SPAuditQuery Please look into this URL.It actually tells you about auditing and different levels of auditing in Sharepoint. ...


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.



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