Sharepoint powershell cmdlets with Node/SPFX - sharepoint

I'm administering a Sharepoint Online site right now. Is there a way to run Sharepoint powershell cmdlets externally from SPFX/ NodeJS. I'm trying to create a UI for disabling versioning for a document library. Seems that disabling versioning could only be achieved through powershell right now.
(Or is there an sharepoint api endpoint for actually doing it, not sure)

You cannot run powershell cmdlets from SPFx. SPFx is a framework to build applications that run in a browser.
But you can use REST API (the easiest way to use it is probably pnpjs to wrap it). You could try something like this (just update the library property):
await sp.web.lists.getByTitle("Documents").update({ EnableVersioning: false });

Related

create Sharepoint Online List template from spfx app

I have to make a list template for my sharepoint online App.
I success with Element.xml and schema.xml files to create a list from a template but I need the template to be available for later use in the list template of the website.
anyone know how I can do this in my spfx app ? (I found with powershell but I have to make the template available by installing the app on the website)
Based on my research and testing, unfortunately there is currently no way to create a list template using SPFx. We can only create lists using SPFX. As a workaround, I still recommend you use Microsoft PowerShell to create and manage custom list templates.
More information for reference:
Creating custom list templates
SharePoint List Creation Using PnP JS And SPFx
Thanks for your understanding.
Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.

How do I update a SharePoint list via REST API in a script ran on another server for Sharepoint 2013 an also Sharepoint Online?

I need to update data in a sharepoint list remotely via a script that runs on a schedule. We currently are using sharepoint 2013 foundation but will be moving to sharepoint online in 6 months or so. I would like to know how to do this via the REST api for both 2013 on prem and online versions. Im having a hard time wrapping my head around all the different auth models, sharepoint products, available apis, frameworks etc and when reading the documentation on MSDN I cant be sure which is relevant to what version of sharepoint etc.. Anyway, so far im thinking or the 2013 on prem sharepoint I should use the High-trust certificate auth option so my script is authenticated via a certificate. Do I need to create an add-in for script to register it as an app that will talk to the rest api? The reason Im not sure is sharepoint itself never really has to call on my script and its not a webpart or page or antyhing that gets displayed on sharepoint so im a bit lost.
As for how to push data into sharepoint online lists, im assuming I would then have to register the script as a providor hosted Add-in and authenticate using OAuth2 via Azure ACS server.
Does this sound like the best way to acheive my goal? Am I on the right track or is their an eaiser option? Is there anyway I can just use a Active Directory user account in the script to make authenticated requests instead of having to create certificates trusts and create addins etc?
Update:
Heres some more info on what I'm trying to do...
The project Id like to start will be a Node or PHP script that runs on a seperate server and pulls data from a third party source, making calculations on it and then pushes the results into some Sharepoint lists. Then running this on a schedule every night to keep the Sharepoint lists up to date. I know how to do everything except getting started with Sharepoint; how to establish the connection and authentication basically.
What id like to do is access the REST apis for lists and libraries from Node or PHP which would obviously be running externally to Sharepoint. I just don't really understand how to get started. My understanding is there is Sharepoint hosted apps (client side javascript that can access the SP apis), and provider hosted apps (which is essentially an iFrame to another web app). So out of the two I'm looking at provider hosted, but do provider hosted apps only run when called? Do they need to present a front end to show in an iframe? My project only needs to push data into lists overnight. And so do I need to register the project as a provider hosted app?? Or how do I go about getting started? And then I'm lead to believe that the app model is the 2013 way of programming for Sharepoint and the new 2016/online way is Sharepoint framework (SPFX). But then the only examples I'm seeing for this is client side apps. The second project id like to do is to make a client side app which will take the data thats in the lists from project 1 and display that in certain ways dynamically using react. So I'm fairly comfortable knowing where to start for project 2, ill just straight into developing a client side react app that uses SPFX. However I'm totally stuck on starting project 1. Where do I start for project 1? What are my options?
As far as I understand your question, You need to update your on prem list from schedular and later you will update the list in your sharepoint online.
We you can create a Provider hosted app and through configuration you can switch your destination easily.
OR you can think new way to do that. You can use Node JS timer service which insert to your on prem usign rest api later the same code will work for online you just need to change the destination.
Currenlty we are also donig it with Node. Below is the simple code to create timer in nodejs.
what is does, it read the crednentials from file and email to the user.It just a simple code and can be use to insert to SP list usign rest api.
https://github.com/halfice/Node-JS-Timer-SharePoint/blob/master/app.js
furthermore It would be more clarify if you could share picture of what you want to do

Integrating Octopus Deploy and Dynamics CRM

I'm using an on premises version of CRM 2011, which I'm about to begin developing against.
We're using Octopus Deploy with some other sites.
It would be great if there was a way to import CRM Solutions using a powershell script or wcf service, rather then someone manually navigating to the site and go through the motions.(we have dev,test and prod environments)
I can't seem to find a non UI method of doing this online. Can anyone suggest a better solution then using the UI?
You can import solution programmatically using ImportSolutionRequest class. Check this link

Different Uses of PowerShell With SharePoint?

Following the release of SharePoint 2010, there has been renewed interest in using PowerShell to manage SharePoint solutions. I'm interested in finding out how my peers are currently using PowerShell with SharePoint, either 2007 or 2010.
For example, I use a PowerShell script to determine the number of sites, sub-sites and pages that have been created in specific web applications. Can you provide details of how you make use of PowerShell?
We're developing some custom SP2010 software. We're using Powershell cmdlets to install and upgrade builds on our test machines, as well as do some initial configuration tasks such as deploying features to certain webs, and creating service apps & service app proxies.
Unfortunately the cmdlets don't seem to play well with PSRemoting, which makes automated build & deploy trickier.
I use PowerShell for installation and debugging purposes. I'm surprised that you haven't used Powershell with SharePoint 2010.
I write quite a few scripts for deploying and managing many solutions. For Example, Every time we deploy our PerformancePoint dashboards, it removes the top the global navigation. I use a Powershell script to re-insert the global navigation based on a XML File that I have created.

Sharepoint: How can I deploy a custom authentication provider?

How can I deploy a custom authentication provider in MOSS 2007?
Is there any provided functionality to do this (like a Sharepoint feature)?
Or do I have to install it in the GAC on each box in the farm manually?
The usual approach for installing extensions like this is to use a feature, yes. However, you won't be using any specialized XML as this kind of extension is not catered for explicitly. So how can you do it? By using an essentially empty feature project that contains an Event Receiver assembly. The event receiver assembly is called automatically by sharepoint for 4 different events: install, uninstall, activate and deactivate. I suggest you hook the install and uninstall events to deploy your provider.
http://msdn.microsoft.com/en-us/library/bb862634.aspx
Make sense?
-Oisin
You can deploy a custom membership provider under minimal trust in SharePoint 2007 using Code Access Security (CAS).
Altough the author seems to not recommend using the GAC since some Sharepoint installations are on a hosted environment and you can play with GAC.
It is often easier to install the
membership provider DLL in the Global
Assembly Cache to achieve full trust,
but in cases where you're working with
a hosted SharePoint site and cannot
deploy to the GAC these instructions
should steer you right.
The detailed article is here. I hope it helps.
The Windows Live Authentication feature of the Community Kit for Sharepoint provides a nice example (with source code) of creating a solution package with a custom authentication provider. A solution package can be deployed to all servers in the farm without manually touching them

Resources