This is becoming a popular approach, but since I got questions on it I thought it worth writing about.
When we first started to work with Office 365, I remember being quite concerned at the lack of Power Shell cmdlets – basically all the commands we’re used to using do not exist there.
By default, if you’re developing a Share Point app it can only be F5 deployed from Visual Studio to a site created from the Developer Site template, but by enabling “side-loading” you can do it on (say) a team site too.
Since the Feature isn’t visible (in the UI), you’ll need a script like this: (Worth noting that you also see Share Point-hosted app webs also in the image above, since these are just subwebs (albeit ones which get accessed on the app domain URL rather than the actual host site’s web application URL).
to activate one) – not showing how to obtain $client Context here.. I also wrote a short companion post about the overall landscape and with some details/examples on the other flavors, at Using Share Point Online and MSOL cmdlets in Power Shell with Office 365 You need to obtain the Share Point DLLs which comprise the .
NET CSOM, and copy them to a folder on your machine – your scripts will reference these DLLs.
A final idea on the Power Shell CSOM front is the idea that you can have “hybrid” scripts which can deal with both Share Point Online and on-premises Share Point.
More examples later, but here’s a small illustration: # get the site collection scoped Features collections (e.g. The 3 approaches I’m thinking of are: post focuses on the last flavor.We encourage you to post on this github issue to let us know about libraries that still do not work well.(NOTE: If you install this preview alongside an earlier version of Visual Studio 2017, the preview of this feature will also be enabled in earlier version.Or how about extending the sample above to not only iterate webs, but also the lists in each - the property I'm updating on each list is the Enable Versioning property, but you easily use any other property or method in the same way: In Share Point 2013 and Office 365, many aspects of search configuration (such as Managed Properties and Crawled Properties, Query Rules, Result Sources and Result Types) can be exported and importing between environments as an XML file.The sample below shows the import operation handled with PS CSOM: As you can hopefully see, there’s lots you can accomplish with the Power Shell and CSOM combination.
If you enter a valid set of credentials and URL, running the script above should see you ready to rumble: Something you might want to do at some point is enable or disable a Feature using script.