How to create a document library in Sharepoint Online using Powerpoint?

I've been trying to create a document library in Sharepoint Online via pwoershell and I've been trying to see if anyone else has the code but the only scripts i could find are for Sharepoint 2010 on-premise and it's not compatible with Sharepoint 2013.
 Can anyone help me?
Thanks!
Dearbhla Bradley

It's SharePoint Client-side Object Model.  Here are few references:
http://msdn.microsoft.com/en-us/library/office/jj193041(v=office.15).aspx
http://msdn.microsoft.com/en-us/library/office/dn268594(v=office.15).aspx
These postings are provided "AS IS" with no warranties, and confers no rights.

Similar Messages

  • How to create a Document Set in SharePoint 2013 using JavaScript Client Side Object Model (JSOM)?

    Hi,
    The requirement is to create ""Document Sets in Bulk" using JSOM. I am using the following posts:-
    http://blogs.msdn.com/b/mittals/archive/2013/04/03/how-to-create-a-document-set-in-sharepoint-2013-using-javascript-client-side-object-model-jsom.aspx
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/1904cddb-850c-4425-8205-998bfaad07d7/create-document-set-using-ecma-script
    But, when I am executing the code, I am getting error "Cannot read property 'DocumentSet' of undefined "..Please find
    below my code. I am using Content editor web part and attached my JS file with that :-
    <div>
    <label>Enter the DocumentSet Name <input type="text" id="txtGetDocumentSetName" name="DocumentSetname"/> </label> </br>
    <input type="button" id="btncreate" name="bcreateDocumentSet" value="Create Document Set" onclick="javascript:CreateDocumentSet()"/>
    </div>
    <script type="text/javascript" src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js"> </script>
    <script type="text/javascript">
       SP.SOD.executeFunc('sp.js','SP.ClientContext','SP.DocumentSet','SP.DocumentManagement.js',CreateDocumentSet);
    // This function is called on click of the “Create Document Set” button. 
    var ctx;
    var parentFolder;
    var newDocSetName;
    var docsetContentType;
    function CreateDocumentSet() {
        alert("In ClientContext");
        var ctx = SP.ClientContext.get_current(); 
        newDocSetName = $('#txtGetDocumentSetName').val(); 
        var docSetContentTypeID = "0x0120D520";
        alert("docSetContentTypeID:=" + docSetContentTypeID);
        var web = ctx.get_web(); 
        var list = web.get_lists().getByTitle('Current Documents'); 
        ctx.load(list);
        alert("List Loaded !!");
        parentFolder = list.get_rootFolder(); 
        ctx.load(parentFolder);
        docsetContentType = web.get_contentTypes().getById(docSetContentTypeID); 
        ctx.load(docsetContentType);
        alert("docsetContentType Loaded !!");
        ctx.executeQueryAsync(onRequestSuccess, onRequestFail);
    function onRequestSuccess() {       
        alert("In Success");
        SP.DocumentSet.DocumentSet.create(ctx, parentFolder, newDocSetName, docsetContentType.get_id());
        alert('Document Set creation successful');
    // This function runs if the executeQueryAsync call fails.
    function onRequestFail(sender, args) {
        alert("Document Set creation failed" + + args.get_message());
    Please help !!
    Vipul Jain

    Hello,
    I have already tried your solution, however in that case I get the error - "UncaughtSys.ArgumentNullException: Sys.ArgumentNullException:
    Value cannot be null.Parameter name: context"...
    Also, I tried removing SP.SOD.executeFunc
    from my code, but no success :(
    Kindly suggest !!!
    Vipul Jain

  • Creating a folder for a document library in SharePoint online

    Hello I am looking for a good place to get started on creating a folder for a document library using a powershell script. Thanks in advance for any help.

    Here is a guide to creating folders and items in a document library for SharePoint Server/Foundation: Creating SharePoint Folders
    and Items with PowerShell. You will need to tailor it to your needs as it's a demo for creating 50,000 items.
    That's step 1 and contains the bulk of what you would need to do. Here's an example of connecting to a library in SharePoint Online using CSOM: Office
    365 - PowerShell Script to Upload Files to a Document Library using CSOM. You won't be uploading files, but the parts where you connect and get a list are what you're interested in.
    Now you'll combine bits from both of these scripts:
    1. Connect to SPO
    2. Get your list (looks like you need to first get the site collection and then the site)
    3. Create a folder
    I figure it would look something like this (note I haven't tested this at all):
    #Specify tenant admin and site URL
    $User = "[email protected]"
    $SiteURL = "https://tenant.sharepoint.com/sites/site"
    $DocLibName = "DocLib"$FolderTitle = "Example Folder"
    #Add references to SharePoint client assemblies and authenticate to Office 365 site - required for CSOM
    Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
    Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
    $Password = Read-Host -Prompt "Please enter your password" -AsSecureString
    #Bind to site collection
    $Context = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
    $Creds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($User,$Password)
    $Context.Credentials = $Creds
    #Retrieve list
    $List = $Context.Web.Lists.GetByTitle($DocLibName)
    $folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder)
    $folder["Title"] = $FolderTitle
    $folder.Update();
    Jason Warren
    @jaspnwarren
    jasonwarren.ca
    habaneroconsulting.com/Insights

  • How can I send an email from Sharepoint Online using sandbox solution?

    How can I send an email from Sharepoint Online using sandbox solution?
    If possible I do not want to use workflow.
    Is It possible to do it without using workflow?

    hello Steven Andrews,
    when any user sends a message using contact us page in SharePoint online.
    1. We are inserting item in Contact Us List . - This is working fine
    for anonymous users also. We have used Office365 anonymous codeplex wsp and it is working fine. Anonymous user is able to insert new record in the Contact Us List.
    2. Once, new record is inserted in Contact Us list, we want to fire email notifying thanks to the user on his email id as well as to our company x person for notification of new inquiry. 
    We tried using Workflow having impersonation step for  anonymous user but it is not working for Anonymous users. Workflow is able to sent the email if someone logged into system but not working for Anonymous user although workflow is getting started
    but not able to send email although used Imperonsation step.
    We are stuck into implementing second step.

  • How to create a document library with the attachments of a task list?

    Hi!
    Basically, I need to create an event handler, that in the time when a file is attached to a task, make a copy of the file in the document library. Unfortunately this requires knowledge in programming and is not even possible for me to install the software
    i need in the company computers to try. Any ideas?      

    Unless you have third party workflow options, custom development IS required.
    There are several options when it comes to the development, some of which do not require admin involvement... but they still require programming.
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • How to Create Custom Timer Job for SharePoint 2010 using Visual Studio 2010?

    While creating timer job Visual Studio showing some kind of error and assembly issues.

    Hi Aryav
    Please provide the errors so that we can resolve your issue.
    Meanwhile go through the step by step process of creation of Timer Job in the articles given below.
    Create and Deploy Custom Timer Job Definition in SharePoint Programatically
    Indul Hassan
    Microsoft Community Contributor
    http://www.indulhassan.com
    You Snooze.. You Lose !!

  • How can I delete a subsite from SharePoint Online using a workflow designed in SPD2013

    Hello,
    I'm trying to build a workflow that will delete a subsite when an item in a list (Job Numbers) on a parent site is changed to a particular value.
    My current workflow is triggered when an item in the Job Numbers list is changed. The workflow checks if the Completed column (a custom column of type choice) has the valued 'archived'. If it doesn't the workflow ends, if it does I want the workflow to delete
    the subsite associated with that item (Job Number).
    The subsite address is easily known as it is simply https://mysharepoint.sharepoint.com/current/[Job Number] 
    I believe I need to use a webservice with the Call HTTP... action but I don't know which webservice or how to implement said webservice.
    Specifically my questions are,
    1. Is there a webservice I can call in a SPD2013 workflow to delete a subsite?
    2. How do I use this webservice in my workflow?
    Please help, I've been stuck on and off for weeks trying to find blogs and walk-throughs to shine some light on this.
    Thanks in advance,
    Dan

    Please find your answers below...
    1. Is there a webservice I can call in a SPD2013 workflow to delete a subsite?
    Site Service : http://<server-url>/_vti_bin/sites.asmx
    Web Method : DeleteWeb
    Parameter : url(string)
    2. How do I use this webservice in my workflow?
    SPD2013 has introduced a new workflow action to call web services. Here is the article.

  • Need to create interactive document library

    Hello Everyone
    I need to create interactive document library in sharepoint 2013. When user uploads document, he should be able to write comment below that document and other users should be able to reply or post other document as well.
    Is it possible to achieve this kind of feature in sharepoint?
    Thanks

    Hi,
    Have you Configure social computing features in SharePoint Server 2013.
    Enable the "SharePoint Server Standard Site Collection features" 
    https://<< Site URL >>/_layouts/15/ManageFeatures.aspx?Scope=Site
    So that missing Social collaboration features are added into webpart catalog.
    thx
    iffi

  • Having trouble uploading sub folders to Sharepoint online using PowerShell

    Hi there,
    I have been attempting to upload folders and files to a document library on Sharepoint Online. I can upload the top-level folder and the files in that folder but when i comes to the sub folders i get this message: 
    New-Object : Exception calling ".ctor" with "2" argument(s): "Access to the path 
    'C:\FilePath\TestFolder\TestFolder1' is denied."
    At C:\FilePath\ImportFiles_Test1.ps1:54 char:29
    +               $FileStream = New-Object IO.FileStream($File.FullName,[System.IO.F ...
    +                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
        + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
    I'm running as an Administrator so I have full access to the folders
    here's my code so far
    #Specify tenant admin and site URL
    $User = "[email protected]"
    $SiteURL = "https://company.sharepoint.com/sites/TestSite"
    $Folder = "C:\Users\user\Documents\SharepointTestFolder"
    $DocLibName = "Admin"
    #Add references to SharePoint client assemblies and authenticate to Office 365 site - required for CSOM
    Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
    Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
    $Password = Read-Host -Prompt "Please enter your password" -AsSecureString
    #Bind to site collection
    $Context = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
    $Creds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($User,$Password)
    $Context.Credentials = $Creds
    #Retrieve list
    $List = $Context.Web.Lists.GetByTitle($DocLibName)
    $Context.Load($List)
    $Context.ExecuteQuery()
    Function ImportFiles()
    #Get name of folder
    $NewFolder = Split-Path $Folder -Leaf
    #upload folder to sharepoint
    $UploadFolder = $List.RootFolder.Folders.Add($NewFolder) #this may not upload folders within folders.
    $Context.Load($UploadFolder)
    $Context.ExecuteQuery()
    $FilesInFolder = Get-ChildItem $Folder | ? {$_.PsIsContainer -eq $False}
    #Loop Through Folder
    Foreach ($File in (dir $Folder))
    #If file
    If($File)
    #Upload file to Sharepoint
    $FileStream = New-Object IO.FileStream($File.FullName,[System.IO.FileMode]::Open)
    $FileCreationInfo = New-Object Microsoft.SharePoint.Client.FileCreationInformation
    $FileCreationInfo.Overwrite = $true
    $FileCreationInfo.ContentStream = $FileStream
    $FileCreationInfo.URL = $File
    $Upload = $UploadFolder.Files.Add($FileCreationInfo)
    $Context.Load($Upload)
    $Context.ExecuteQuery()
    Else
    recurse ImportFiles
    ImportFiles
    If anyone could help me I'd be so grateful!!
    Thanks!!
    Dearbhla Bradley

    The exception is pretty clear. for some reason the script is not able to open the folder TestFolder1 on the local hard drive.
    I noticed in the script you have specified the $Folder variable to be "C:\Users\user\Documents\SharepointTestFolder" while the exception is for "C:\FilePath\TestFolder\TestFolder1"
    Will you please help me understand this difference?
    Also, sorry I'm not familiar with the "recurse" calling method. I'm suspecting you're telling it to call the ImportFiles() function again, though if this is the case it looks to me that it's reusing the same $Folder variable that was defined at the start,
    rather than using the folder object you have just identified.
    Jason Warren
    @jaspnwarren
    jasonwarren.ca
    habaneroconsulting.com/Insights

  • How to rename the SharePoint Document Library existing file name using Web service

    Hi,
    How to rename the SharePoint Document Library existing file name using SharePoint Web service.
    Is it possible. How could i do it?
    Thanks & Regards
    Poomani Sankaran

    Hi,
    Lists.UpdateListItems Method
    would be helpful for your requirement.
    Here is a blog with code demo for your reference:
    http://blogs.msdn.com/b/knowledgecast/archive/2009/05/20/moss-using-the-list-web-service-to-rename-a-file.aspx
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • How can I copy documents from a Sharepoint On Premises library to a Sharepoint Online library and at the same time preserving their metadata?

    How can I copy documents from a Sharepoint On Premises library to a Sharepoint Online library and at the same time preserving their metadata?
    I use the Open Explorer Windows to drag and drop the files, but the metadata are not copied. Thanks.

    To maintain the metadata you'll need to use one of the third party tools that does this kind of migration.  Metalogix has a product with a free trial that we have used before.  (Don't remember whether the free version maintains metadata or not).
     You can read about it here:
    http://www.metalogix.com/Products/Content-Matrix.aspx
    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

  • Updating a title column in list that is a lookup column to document library in sharepoint designer workflow 2010

    Hi I have a requirement to create a list item in Contracts List when a document is uploaded in Contracts Vendor library.
    Contracts List will
    have  columns - Contract Name ( title column), Contract Number, Contract Start date and end date.
    Contracts Vendor library will have Contract
    Name,Contract NUmber.
    User will select the Contract Name from drop down ( this is look up column linked to Contract Name in Contract
    List).When user uploads document in Contract Vendor library then item should be created in Contract List with selected Contract Name and
    Contract number .
    Contracts and Contracts Vendor are related by look up Contract Name. Contract Name is internally a title column in
    Contracts List.
    Issue1 :
    Since Contract number is look up column, while I am creating item the Contract name is not getting updated in
    Contracts List. I have to use sharepoint designer workflow to achieve this task. Title colum or Contract Name shows no title.
    Issue 2:
    One
    more issue I am facing is that Contracts List has Section and Division cascaded drop downs when i select values from section and division
    dropdowns and save item in Contracts list the values are getting saved in Contract List.
    Could anyone suggest me how to handle this ? I am
    attaching the screenshots of the list and library structure. TRuly appreciate your help.
    Below are screenshots of the list structure

    Hi,
    According to your post, my understanding is that you wanted to update a title column in list that is a lookup column to document library in sharepoint designer workflow 2010.
    I try to reproduce the issues as follows:
    Create a custom list named Contracts List, add columns: Contract Name ( title column), Contract Number(Number), Contract Start date(Data and Time) and Contract End date (Data and Time).
    Create a document library named Contracts Vendor library, add columns: Contract Name(Lookup), Contract NUmber(Lookup).
    Create a workflow associated to the Contracts Vendor library.
    Add action: Create List Item.
       5. Start the workflow automatically when an item is created.
       6. Upload a document, select the Contract Name and Contract NUmber, the workflow will be started automatically.
       7. Open the Contracts List, an item will be added with the Contract Name and Contract Number in the Contracts Vendor library.
    Thank you for your understanding.
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Powershell Script to create "custom" Document Library

    I have a powershell script which creates a Document Library for every user in AD.
    This works, but rather than using the default Document Library I want it use a custom Document Library.  However this isnt working.
    My script to create the default Document Library is this...
    [System.Reflection.Assembly]::Load("Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c")
    $site = new-object Microsoft.SharePoint.SPSite("http://servername/sitename");
    $siteweb = $site.OpenWeb();
    $webs = $siteweb.Webs;
    $strFilter = "(&(objectCategory=User)(name=accountname))"
    $objDomain = New-Object System.DirectoryServices.DirectoryEntry
    $objSearcher = New-Object System.DirectoryServices.DirectorySearcher
    $objSearcher.SearchRoot = $objDomain
    $objSearcher.PageSize = 1000
    $objSearcher.Filter = $strFilter
    $objSearcher.SearchScope = "Subtree"
    $colProplist = "samaccountname"
    foreach ($i in $colPropList){$objSearcher.PropertiesToLoad.Add($i)}
    $colResults = $objSearcher.FindAll()
    foreach ($objResult in $colResults)
    $objItem = $objResult.Properties; $objItem.samaccountname
    $listTemplate = [Microsoft.SharePoint.SPListTemplateType]::DocumentLibrary
    $listId = $siteweb.Lists.Add($objItem.samaccountname, "", $listtemplate);
    $list = $siteweb.Lists.GetList($listId, $true);
    $roleDef = $siteweb.RoleDefinitions.GetByType("Contributor");
    $user = "domain\" + $objItem.samaccountname;
    $rolAssign = new-object Microsoft.SharePoint.SPRoleAssignment($user, "email", "name", "notes");
    $rolAssign.RoleDefinitionBindings.Add($roleDef);
    if(!$list.HasUniqueRoleAssignments)
    {$list.BreakRoleInheritance($true);}
    for ($i = $list.roleAssignments.Count - 1; $i -gt -1; $i--)
    { $list.RoleAssignments.Remove($i) }
    $list.RoleAssignments.Add($rolAssign);
    $list.Update();
    Now I have a custom Document Library named "TESTLIB" so if I substitute the line:
    $listTemplate = [Microsoft.SharePoint.SPListTemplateType]::DocumentLibrary
    with
    $listTemplate = [Microsoft.SharePoint.SPListTemplateType]::TESTLIB
    Then it errors with this...
    How can I script powershell to create a "custom" Document Library?
    Thanks

    The below link should help you in creating custom document library using powershell
    http://blogs.technet.com/b/heyscriptingguy/archive/2010/09/23/use-powershell-cmdlets-to-manage-sharepoint-document-libraries.aspx
    Vinod H
    Thanks for the link but I cant see anything to assist creating a custom library?  Was there something in paticular you saw?

  • How to create external content type in sharepoint for salesforce account

    Can anybody help me on How to create external content type in sharepoint for salesforce account.
    I wanto upload documents to a document library which should sync with accounts in saleforce.
    thanks in advance

    Hi,
    The following materials would be helpful:
    Tutorial: Access Salesforce Leads in SharePoint through an External List
    http://geekswithblogs.net/dataintegration/archive/2014/02/03/tutorial-access-salesforce-leads-in-sharepoint-through-an-external-list.aspx
    Salesforce SharePoint Integration – Best Practices
    http://rainforce.walkme.com/salesforce-sharepoint-integration-best-practices/#.VFxra3mKAeE
    If you want to upload documents to SharePoint document library from the Saleforce, we can also customize your own web service using SharePont .Net Client Object Model or REST to achieve it.
    Best Regards 
    Dennis Guo
    TechNet Community Support

  • How to check A document library that has document publishing enabled and content approval

    HI
    1) how to check A document library that has document publishing enabled
    2)A document library or a list that has content approval enabled
    adil

    For both question, check version settings of that library
    >>1)Document Version History "Create
    a version each time you edit a file in this document library?" should set to either create major versions or Create
    major and minor (draft) versions.
    http://office.microsoft.com/en-us/sharepoint-server-help/publish-or-unpublish-a-version-of-a-file-HA101862529.aspx
    >>2)Content Approval  "Require
    content approval for submitted items?" should be set to Yes
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

Maybe you are looking for