Is there a way to copy only views from a Sharepoint 2010 library to SharePoint online library? - powershell

I have a SharePoint Online 2010 site, I have migrated all the content from SP 2010 to SPO. Now I want to only recreate the views from the source site (SP 2010). Because there are so many views, doing it manually is going to take a lot of time. So, is there any chance that I can recreate the views same as the one's in the source using Powershell or any other language?

When it comes to "logs"/"reports" in SharePoint online, it is not so easy to get them, but still I have managed to found a couple of ways. Check this article that I have wrote about how to get user's activities in SPO: https://www.alight.ro/Articles/Efficient-Ways-to-monitor-Site-Collection/
It contains both manually and programmatically ways.
If you prefer to do it programmatically, the best way is by using Exchange Online module . By using a simple command "Search-UnifiedAuditLog" you can get all kind of activities users have performed on a file: download, view, edit etc. And all you have to do is to write a script. See sample code:
[enter image description here][1]
In the article you will find what represents each line of code.

Related

How to upload files and attachments to the sobject record using REST API?

Salesforce has two different UIs and in accordance with it, it has the possibility to store attached files differently.
Two files were uploaded via the classic UI and they are marked as 'attachments'. Other files were uploaded through the new UI and they are marked as 'files'.
I want to upload all of these files using REST API. I cannot find the proper documentation. Can somebody help me with this?
That's not 100% true. In SF Classic UI you were able to upload Files too. It's "just" about knowing the right API name of the table and you'll find lots of examples online.
Attachment and Document objects have exactly same API names, you can view their definitions in SOAP API definition or in REST API explorer (there was something which you can still see in screenshot in here, seems to be down now, maybe they're moving it to another area in documentation...)
The Files (incl. "Chatter Files") are stored in ContentDocument and ContentVersion object. The name is unexpected because long time ago SF purchased another company's product and it was called "Salesforce Content". In beginning it was bit of mess, now it's better integrated into whole platform but still some things lurk like File folders can be called Libraries sometimes in documentation but actual API name is ContentWorkspace. The entity relationship diagram can help a bit: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_erd_content.htm
ContentDocument is a header to which many places in SF link (imagine file wasting space on disk only once but being cross-linked from multiple records). It can have at least 1 version and if you need to update the document - you'd upload new version but all links in org wouldn't change, they'd still link to header.
So, how to use it?
REST API guide: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_insert_update_blob.htm
or maybe Chatter API guide (you tagged it with chatter so chances are you already use it): https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_files.htm
some of my answers here might help (shameless plug). They're about upload and reading data too and one is even about data loader... but you might experiment with exporting files first, get familiar with structure before you load?
https://stackoverflow.com/a/48668673/313628
https://stackoverflow.com/a/56268939/313628
https://stackoverflow.com/a/60284736/313628

SharePoint 2013 Powershell - Moving Document Liobrary to New Site Collection

I am trying to move document libraries, from one site collection to another and retain of the metadata such as Modified By, Date Modified etc.
I have tried using the 'move' function within SharePoint 2013 Content and Structure but unfortunately this doesn't extend to across site collections.
I have tried multiple PowerShell scripts they successfully copy the file from one Site Collection to another but do not retain the metadata.
Any ideas, would be greatly appreciated.
Thanks.
have you tried saving the library as a template? You can mark the template to keep the contents.
Then you can deploy a new library from that template (Site actions / More options / Template name), and after that delete the template.
Additionally you can move it between servers. Go to the Site settings, there to the template gallery and download the template you just created. Now you can move it to another server or application.
Hope it helps.
Take a look at the SharePoint migration tools. Some of them offer free trials for limited amounts of data.

Previewing files so as not to require download

Facebook has a nice way to preview powerpoint files.. It goes to a microsoft link, e.g. link. You can browse the presentation etc, all very nice and useful for the user and Facebook.
However, I cannot find any sort of API doing that with microsoft.
I found this blog post, which is kindof what I want, but its not referencing any API that I can use to produce this programmatically.
I have a website which users can store files (also powerpoint presentations) and would like them to be able to preview it.
Has anyone got any experience with this? Preferably not going through microsoft route (if possible)..

CMS with Word import or paste

I am working on a project where we are taking a bunch of documents authored using MS Word and placing them online. Currently they are being published as PDF documents in order to maintain the formatting.
We are evaluating Content Management Systems (CMS), however, there is a bit of reluctance among the content publishers to use the CMS built in WYSYWIG editor. I can understand why, they are nowhere near as good as Word!
Some CMS have decent 'paste from Word' functions, but the one I have found that handles images as well is this Wordpress pluging.
My question is - are there any Content Management Systems that have been built with Word integration in mind? Something that makes it as easy as possible to publish Word documents as HTML.
So far from what I have seen, Microsoft Sharepoint had the best integration with the MS Office. I think most of them use Sharepoint as a intranet portal, but it could be also hosted as a public facing website. But compared to other CMS, it can be little pricey. But it has tons of features apart from content management.
Sharepoint Demo
Public Facing Sharepoint Websites
Microsoft Word does publish documents as HTML.
File > Save As > Web Page (Filtered)
Office.com - Save a document as a webpage
ahmednuaman/gdrive-cms-php uses Google Drive as a pseudo back-end to store and edit pages (Documents).
The self-hosted PHP and MySQL CMS requests text/HTML-exports of to display as web pages.
It also simplifies authentication and group permissions (if the editors are already Google/Drive users).

Office integration (Word) - intercepting save

I am planning to implement a small in-house document management system. It must have a web GUI for managing a remote folder structure stored in a database. In these folders are word documents stored (physically as blob in a database). Whenever a user clicks on a document link, a word binary is downloaded via browser and (hopefully) opened in Word on the user's PC.
This is the easy part ;)
Now the user hits "Save" or Ctrl-S. I want to have a functionality programmed inside Word that calls a custom function (maybe in a .NET DLL) that uploads the saved file back to the server (HTTP). The hard part seems to me:
How to intercept the Save process to call the extension functionality
How to deploy this to multiple users
Mike's link to the question I answered should do it for intercepting the file save. The specific button idMso for File->Save is "FileSave"
To deploy it to several users machine you can either
Create a setup project that will create an msi that you can run on all the users machines
if it's an intranet scenario, you can keep the assemblies on a network location and just add the neceassary registry settings to all the users machines. This article should describe the settings that you need to include. You would just need to change the path setting to point to the network location.
AFAIK, this is what Alfresco is doing with its Microsoft Office Add-ins (never tested myself though). As Alfresco is open-source, it must be possible to look at what they are doing. Or just ask your questions on Alfresco's forums.
You can try to override "save" from the ribbon or build your own ribbon tab with the behavior you want. It may be trickier overriding "Ctrl-S".
Overriding the ribbon: StackOverflow Question
Video on altering a standard ribbon button: Office Developer Center