Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [csom]

The client-side object model (CSOM) provides access to a subset of the SharePoint Foundation server object model, including core objects such as site collections, sites, lists, and list items and allows you to program against these from client side applications.

1
vote
1answer
11 views

Remove an external user access for a Folder/Document in a Document Library Programatically

I have shared a folder/document to an external user (outside the organization) in SharePoint online doc library. An email to the new user is shared with One time passcode to access the file. Now, the ...
3
votes
1answer
30 views

Project Online CSOM without using SharePointOnlineCredentials

We have a console application running every night which updates some project plans with CSOM. This uses the SharePointOnlineCredentials for authentication. But the IT departments wants to change the ...
1
vote
1answer
18 views

Creating a document library from custom template with Folder structure inside using CSOM

How can one create a document library from custom library template with Folder structure inside using CSOM? I have created my template and when creating an instance of that manually folders are ...
0
votes
1answer
23 views

csom - how to retrieve a file by its document id url without knowing the list

Is there a possibility to retrieve a file by its document id url without knowing the list in which the file is stored? I know I can do a caml query on a list. But actually the file can be stored in ...
0
votes
0answers
8 views

Move a node in Quicklaunch using csom

I want to move an existing quicklaunch node to become a childnode of another node. Using Server Side Object Model it is possible to move a node to the last position of a parent node. Example: ...
0
votes
1answer
16 views

Access denied while changing ContentTypeId

I got an error when I have Contribute permission for site: Access denied. You do not have permission to perform this action or access this resource. my code is uploading the file and then trying ...
0
votes
0answers
9 views

Optimize Retrieval of Multiple Lists

The below code snipped retrieves all items within each list in a subsite. Then filters by list title so that only information from lists containing "RDTEN" or "procurement" in their title get parsed. ...
0
votes
0answers
16 views

Create link in document library SPO

I'm trying to create a link in a document library pointing to another document library. Like this : But I want to do it by code in C# for SharePoint Online. I've followed numerous guides but can't ...
0
votes
1answer
66 views

CSOM + SharePoint Online - unable to get list item role assignments

I have made a very simple CSOM program where I have fetched a List Item and I have verified that it has listItem.HasUniqueRoleAssignments = true So with that being the case, I want to get the List ...
0
votes
2answers
31 views

CSOM CAML displays all fields

I would like to reduce the no of fields that I get from CAML query. The List has more than 100 fields, which is causing a lot of performance issues. In SSOM the SPQuery object has a query....
1
vote
1answer
36 views

Can't retrieve all Items from all lists that reside on a single subsite

SP Community, I am absolutely stumped and desperate for help. I have been up and down StackExchange trying to get 3 separate attempts to - 1. query all of the lists within a subsite and to then - 2. ...
1
vote
2answers
27 views

Export/Import Glabal term store

We are migrating Global term store from SharePoint 2013 to SharePoint Online. Can i get the scripts to export term store from SharePoint 2013 in a text file and then import that in SharePoint Online? ...
1
vote
2answers
33 views

SharePoint Online “User cannot be found” error

One of the users of a C# app I work on is getting the error "User cannot be found" when the app tries to read the following fields from a SPO file: context.Load(csomFile, f => f.CheckOutType, ...
0
votes
1answer
38 views

How To: Filter A Query on All Lists Based on Title Contains

I have queried all of the lists within a subsite but need to filter based on criteria in the title. I then need to display the filtered list contents. Is this possible if the list contents are not ...
0
votes
0answers
16 views

Retrive storage metrics data with JavaScript on SharePoint 2013

Is there any possibility to retrive data which is in ../_layouts/15/storman.aspx ? The way which mentioned below is not what I need. I need to learn folders size, % of Parent and Last Modified dates. ...
0
votes
0answers
21 views

how to set document set welcome page view programmatically using csom

I am trying to set default view of Document Set programmatically using .NET CSOM but no luck. So far, I have tried below. var revSet = DocumentSetTemplate.GetDocumentSetTemplate(context, ...
0
votes
1answer
26 views

How to get id of the modern experience id in sharepoint online?

How to get the id of the folder in modern experience Example:https://xyz.sharepoint.com/sites/sample/Lists/Special%20characters%20list/AllItems.aspx?id=%2Fsites%2Fsample%2FLists%2FSpecial%...
2
votes
0answers
15 views

I need to replace a Domain Group (Office 365 group) with another Domain Group (Office 365 group) on SharePoint Online

I have an Office 365 group added, for e.g. "ABC" which could be present at any of the below level. Permissions are broken at any level below Site Document Library Pages Page 1 Page 2 ...
1
vote
1answer
49 views

To connect to SharePoint Online Client Context using browser credentials from powershell

I am using below code to connect to SPO from powershell, but we have multi factor authentication in SharePoint. So I want to give credentials from browser instead of script. Please suggest as i ...
2
votes
2answers
40 views

SharePoint Online folder with “#” not found

I am using the SharePoint Online CSOM library (16.1.8316.1200) to retrieve info about a SharePoint Online folder using the web.GetFolderByServerRelativeUrl. This works great except for when the folder ...
0
votes
2answers
20 views

powershell to disable community template for the sub site in sharepoint 2013?

I have requirement in which, if a user creates a sub-site in a sitecollection then community template feature should not be available to him or he should not be able to see it.
1
vote
1answer
33 views

Managing the metadata of Document Sets using C# and CSOM

How to manage the metadata of document sets using C#+CSOM. Any sample code is appreciated. below is the code i tried for creating the document set. .... ..... ContentType ...
1
vote
1answer
17 views

Twitter feed programmatically on modern page

Building a mvc app for sharepoint. Anyone know how to programmatically add a twitter feed on modern page in sharepoint?
0
votes
1answer
28 views

Capabilities we can have inside remote event receivers

I have an on-premises SharePoint 2013 site, and the site has a custom list, and this list has an event receiver linked to it, where the event receiver do the following steps, when a list item is ...
0
votes
1answer
52 views

SharePoint Online/365 invite external user CSOM PowerShell vs C#

I have a PowerShell script that sends a user an invitation email. Which works. The user I'm testing with gets an email invitation to access the SharePoint site each time I run it. I got the script ...
0
votes
1answer
27 views

How to migrate Global term store from SharePoint 2013 to SharePoint Online?

We are migrating Global term store from SharePoint 2013 to SharePoint Online. Can i get the scripts to download the term store and then upload that in SharePoint Online? We want to upload/download ...
1
vote
1answer
25 views

How to get client assemblies within a Non SharePoint Machine?

I am running CSOM code in PowerShell to access data of SharePoint 2013 sites. I am adding below lines to load the DLLs in my machine. These lines expect these DLLs to be present in this location. Add-...
2
votes
1answer
26 views

How to get custom reusable workflow feature in CSOM?

I have created a custom reusable workflow in SharePoint Designer. I am facing an issue after deployment of workflow. I have to activate the workflow feature with CSOM but I am not able to get that ...
1
vote
1answer
24 views

Query large list with indexed column doesnt work

I am querying a large list and it works well if I don't put any condition in where clause. I am trying to get items greater than some ID(actual requirement is to get items Created > Today()), as ...
1
vote
3answers
230 views

How to get Field values of a list item using CSOM Powershell?

How to get Field values of a list item using CSOM Powershell? I am using below code: foreach($field in $List.Fields) { write-host $field } I am getting the values as output: Microsoft....
1
vote
2answers
50 views

What is an alternative for New-Object Microsoft.SharePoint.SPFieldUserValue() in CSOM Powershell

I want to get the display name of created by and modified by fields for a user in a SharePoint 2013 List using CSOM in powershell. I know that can be acheived by: New-Object Microsoft.SharePoint....
1
vote
1answer
31 views

How to check if ListItem DisplayName is initialized in CSOM (SP2013)?

I currently have code that looks like this: public static string GetListItemDisplayName(ClientContext clientContext, ListItem listItem) { string displayName; try { ...
1
vote
4answers
74 views

How to get lists of all subsites and sites in powershell CSOM for SharePoint 2013

i want to input one site collection and want to get all the lists of that site as well as subsites. but i am unable to iterate through all subsites. Please suggest. I am using csom in powershell for ...
1
vote
1answer
32 views

Installing a Remote Event Receiver on “Site Pages” library using BaseTemplate ID

I need my Remote Event Receiver to install to the "Site Pages" library without referencing the Title/name, but rather use the ID (119) or GUID. I can't use title because the support for multiple ...
1
vote
2answers
54 views

How to set search scope to specific site or subsite using KQL powershell csom

I want to search for content in a specific subsite in sharepoint online. How can I set scope of search to subsite in KQL using powershell csom? I tried the following query: $queryText="createdby:$...
1
vote
2answers
79 views

how to loop through item id and update items via JSOM - SharePoint Online

Here is my snippet code below.My aim is to simply loop through item ids and update the list in batches. I need help with using CSOM to do this I need this as currently when i send a batch of over 800 ...
1
vote
2answers
43 views

SharePoint site online deletion

I mistakenly launched a script that allows the removal of SharePoint online sites and I deleted a very important site. Is there a way to retrieve it?
1
vote
0answers
47 views

How to Generate Audit log Excel Report programmatically in SharePoint Online?

I am using below code to enable Audit report. Microsoft.SharePoint.Client.Site site = targetCtx.Site; Audit audit = site.Audit; targetCtx.Load(site); targetCtx.Load(site.RootWeb); ...
1
vote
0answers
38 views

batch updating processing with csom (Timeout issue)

I have just over 800 records i'm trying to update but I keep getting timeout error despite the fact i'm setting the timeout to indefinite like below:- clientContext.RequestTimeout = -1 see my snippet ...
1
vote
1answer
44 views

SharePoint CSOM SendMail From address ignored

I am sending mail with: var spContext = SharePointContextProvider.Current.GetSharePointContext(Context); using (var clientContext = spContext.CreateUserClientContextForSPHost()) { var emailp = ...
0
votes
2answers
72 views

How to load FeatureDefinitionScope value via csom?

I load features using the code bellow: string siteUrl = "http://MyServer/sites/MySiteCollection"; ClientContext clientContext = new ClientContext(siteUrl); Web site = clientContext.Web; ...
0
votes
1answer
38 views

Getting data from another website using C# and displaying in a web part

I'm trying to read information sitting in another wesbsite using C# and displaying the result in sharepoint 2010 web part. I read about httprequest but I'm failing to implement it. Please anyone help ...
1
vote
1answer
62 views

Is there a way to get CSOM ClientContext by having cookies and a Form Digest?

I have been trying to do an interesting proof-of-concept/experiment Get SharePoint user's cookies from the browser Pass these cookies to an Azure Function By having cookies only - determine who the ...
0
votes
2answers
149 views

How to load all list items using caml query?

I'm using SP 2013. And I have a Wiki Page Library. I try to load all items from this list. I'm using the following code: var context = new ClientContext("SiteUrl"); context.Load(context.Site); ...
1
vote
0answers
37 views

Modify the List View Web part's Miscellaneous ( Form Template Name ) value using C# in SharePoint 2016

Is there any way to change the List View Web part's Miscellaneous ( Form Template Name ) value using C# in SharePoint 2016
0
votes
1answer
21 views

add listitem to custom list

when i try to add listitem to custom list by CSOM there is a problem in getting the name of fields field name in the list is"Pieces Unaccompanied Hold Baggage(Rush)" ,but when i try to add item ,error ...
1
vote
1answer
37 views

How to programmatically change a user field restricted to a single Sharepoint group in CSOM

It possible in CSOM to change a user field to restrict the People picker to a single Sharepoint Group?
1
vote
1answer
623 views

Programmatically Add link to Homepage

The question is quite basic however I'm not able to find any "links" to it... I want to customize Homepage, programmatically adding hyperlinks as you can "manually" do from "Edit" page. How to ...
1
vote
1answer
20 views

Programmatically Delete Web Part

I have been able to add a web part, thank to this post, using code like: limitedWebPartManager.ImportWebPart(webPartSchemaXml) However now I'm not able to remove the Web Part anymore by Editing the ...
1
vote
1answer
39 views

SPFX, CSOM for SPO Development

I need to surface some information from SPO within SPO page. I am familiar with on-premise CSOM script webparts where I simply added JavaScript and CSOM code. In SPO, can I still use the same ...