Posts

Showing posts from August, 2015

Enabling SideLoading in SharePoint Online for NON-DEVELOPER SITE

Image
Note1: By default this feature is enabled in “Developer Site”. So if your site is created with “Developer Site” template don’t read below (This is for the non-developer site) Note2: Enabling this feature is not recommended for Production Site. Sideloading apps is insecure. The main reason for blocking sideloading by default on non-developer sites is the risk that faulty apps pose to their host web/host site collection. Apps have the potential to destroy data and make sites or, given enough permissions, can even make site collections unusable. Therefore, apps should only be sideloaded in dev/test environments and never in production   (Ref: http://blogs.msdn.com/b/officeapps/archive/2013/12/10/enable-app-sideloading-in-your-non-developer-site-collection.aspx ) Pre-requisites -           Install Windows PowerShell from Windows Management Framework (I have installed Windows Management Framework 3.0) – ( https://www.micro...

JavaScript Namespaces

Good explanation of creating namespaces in javascript, http://www.kenneth-truyers.net/2013/04/27/javascript-namespaces-and-modules/

SharePoint Copy large document library by CSOM

class Program  {  static void Main(string[] args) {  ClientContext clntContext = new ClientContext(" https://<<SiteUrl>> "); FileCollection collFile = clntContext.Web.GetFolderByServerRelativeUrl(" https://<<DocumentLibraryUrl>>/").Files ; clntContext.Load(collFile); clntContext.ExecuteQuery();  foreach (File file in collFile) {  file.CopyTo(" <<Destiation document library url>> " + file.Name, true); Console.WriteLine(file.Name + " is copied successfully"); clntContext.Load(file); clntContext.ExecuteQuery(); }  Console.ReadLine(); } } }

Retreive User Profile Properties by using .NET CSOM in Office 365 / SharePoint Online

Image
using System.Text; using System.Threading.Tasks; using System.Security; using Microsoft.SharePoint.Client; using Microsoft.SharePoint.Client.UserProfiles; namespace UserProfileCSOM { class Program { static void Main( string [] args) { const string serverUrl = "<<Site Url>>" ;             ClientContext cltContext = new ClientContext (serverUrl); var userAccountName = "i:0#.f|membership|test@test.com" ; var myUserName = "test@test.com" ; var myPassword = "*****" ; var secureStringPassword = new SecureString (); myPassword.ToList().ForEach(c => secureStringPassword.AppendChar(c));   var creds = new SharePointOnlineCredentials (myUserName, secureStringPassword); // Requires SecureString() for password cltCont...