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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
14 views

Can't upload a file to sharepoint site's file directory using CSOM C# console app

I am trying to upload a file to a specific site's file directory in my org's SharePoint. I created an app on https://OrgTenant.sharepoint.com/sites/MySite/_layouts/15/appregnew.aspx. Then, I gave it ...
Jaelen's user avatar
  • 1
0 votes
0 answers
9 views

how to use CSOM in UWP in Visual Studio to grab a list or site's full user permissions

I've tried searching for tutorials or guides but could anyone point me in the direction of using a .NET application that grabs a sharepoint online site/lists users and their permission levels? Thank ...
d delep's user avatar
0 votes
1 answer
22 views

SharePoint List, help deleting the Title field or remove from defaultview?- using CSOM

Using CSOM for SharePoint Online Site Collection, able to create lists, edit lists items, add list items, etc. Just can not figure out how to either delete the 'Title' field or just remove it from the ...
Benny H.'s user avatar
0 votes
0 answers
13 views

How to get a Video Thumbnail using PowerShell on SharePoint SE version?

I have a SharePoint (Subscription Edition) document library that is hosting some videos I uploaded. How can I get the video thumbnails using PowerShell? Again, the SharePoint version I am targeting is ...
Jean Paul Larach's user avatar
0 votes
0 answers
23 views

Error Connecting to SharePoint 2019 via CSOM

We are getting a 403 error when trying to connect to a SharePoint 2019 site via CSOM in one of our environments. The accounts being used have the correct permissions and I am able to connect to the ...
Rogerb's user avatar
  • 21
0 votes
2 answers
64 views

SP 2019 CSOM Console App

I am trying to develop a CSOM console app for a SharePoint 2019 site and I'm having trouble authenticating. I've tried: context.Credentials = new NetworkCredential("username", "password&...
Rogerb's user avatar
  • 21
0 votes
0 answers
16 views

How to get all Default sites of a SharePoint using CSOM?

I have tried to getting all the sites of the tenant but I can able to get all Site Collection as well as the Sub Site. But I can't get the Default site like CompliancePolicyCenter, ...
Dood's user avatar
  • 1
0 votes
0 answers
14 views

orphaned Site using CSOm

I'm looking to get the orphaned site using CSOM for my Application but I don't get any reference regarding to this. Is there any way to get the orphaned site using CSOM?
Dood's user avatar
  • 1
0 votes
0 answers
44 views

CamlQuery Recursive Search Under Specific Parent Folder

I am trying to recursively search all folders and files under a specified folder for given text. For example sake, lets say my file directory is as follows- /sites/UsersTeam/Shared Documents/Folder A/...
A_Frustrated_CSOM_Learner's user avatar
0 votes
0 answers
68 views

SharePoint CSOM API - Current site is not a tenant administration site

We use this code to iterate tenants site collections: string url = $"https://{initialDomainName}-admin.sharepoint.com"; var context = new ClientContext(url); context.ExecutingWebRequest += (...
Nazar's user avatar
  • 1
0 votes
0 answers
20 views

Using CSOM, How to check-out a list item?

I want to update a list item in a list with versioning enabled on it. I should check out item before update, update it , and then check it in. I find CSOM code for Check in/out a file in a document ...
Hamed's user avatar
  • 1
0 votes
0 answers
17 views

How to add a lookup when creating a new ListItem?

I've found multiple Q/As here and other resources about adding a lookup value to a new ListItem upon creation and, based on those examples, it seems like it should be straight forward. However, I ...
ChiefTwoPencils's user avatar
1 vote
0 answers
25 views

How to get the comments of a file by using CSOM?

I have an issue related to fetching the comments inside file/document by using CSOM. This is an image of a comment that I want to get from file: I used code like this but it doesn't work for me. It ...
Harry Liu's user avatar
0 votes
1 answer
43 views

Add Enterprise Keywords to a library programatically

When we go to the settings of a library, we can navigate to Enterprise Metadata and Keywords Settings In here there is a checkbox that can be activated. If activated through the UI, the checkbox stays ...
Tiago Duarte's user avatar
  • 5,457
1 vote
2 answers
37 views

Roadblocks in adding fields via CSOM in SPO

I have a program that is creating some lists and adding the necessary fields to the lists in SPO. I have marked some of these fields as Required, but in list settings they do not show up as Required. ...
entryton's user avatar
  • 332
0 votes
1 answer
46 views

How to migrate files to SharePoint using CSOM while retaining publishing history

We are planning to migrate documents from an existing Document Management System into SharePoint Server 2019. The chosen API is CSOM, since there is a chance that the target SharePoint solution will ...
Lars Kohsel's user avatar
0 votes
0 answers
19 views

Due to Multi-geo is there any changes in the CSOM data or API call?

Consider if a Tenant is enabled Multi-Geo, using CSOM will cause any changes in the returned data? Any modification is required for CSOM API?
Janakiram's user avatar
0 votes
0 answers
19 views

Some info relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied

I am trying to find some documentations about the "ShareLink" SharePoint REST api end point, and i found the below 2 links :- https://learn.microsoft.com/en-us/dotnet/api/microsoft....
microsoftdeveloperdesigner's user avatar
0 votes
0 answers
49 views

Connecting to SharePoint using third party server via middleware Web API with CSOM

I'm developing a solution to connect from a third party API to SharePoint using a middleware. The following diagram shows how the architecture works. In here, I want to connect with many customers in ...
Ramesh Perera's user avatar
0 votes
0 answers
301 views

Update moderation status (Approval)

I want to update the Moderation Status of a Document (minor version enabled) from Pending to Approved or Rejected without affecting the Modified By column. I have tried ootb flow Action 'Set Content ...
Orange Juice Jones's user avatar
0 votes
0 answers
616 views

download a SharePoint file to a specific folder on the local computer using c# and CSOM

I try to download a online file programmatically, which is stored in a document library to a local folder. I know that I need to open a stream and then copy the stream to the local drive, but I'm a ...
Matthias's user avatar
0 votes
1 answer
740 views

Get all Folders and Files recursively in SharePoint online with CSOM in C# and store it in one list where I can work with it

my current code get all the folders from a root site. After that it uses the itemId. From that itemId it gets the subfolders and files. I don't know how I can store the Id's persistent that I can loop ...
Matthias's user avatar
0 votes
0 answers
120 views

CSOM - Field or property "QueryText" does not exist

I am attempting to search files and folders held in SharePoint for a user entered phrase but consistently get the following exception: Microsoft.SharePoint.Client.ServerException HResult=0x80131500 ...
phuzi's user avatar
  • 105
0 votes
1 answer
205 views

Random error: The request was aborted: Could not create SSL/TLS secure channel

I'm writing a C# Winform application with the help of CSOM library. I need to navigate a SharePoint site and, when I point a PDF file. I need to download it and show it. The basic routine (I found on ...
SteMMo's user avatar
  • 101
0 votes
1 answer
121 views

Create a tree view in c# on SharePoint Online Document Library Basis with CSOM

I want to create a Treeview in C#. My basic data is stored in a SharePoint Online DocumentLibrary. I authenticate with a user and I want to show the folders and files as a tree view in Azure function ...
Matthias's user avatar
0 votes
1 answer
716 views

Access SharePoint Online via CSOM with access Token from Username/Password in Azure Functions

I want to access a SharePoint site with a Token, which I get by Username and PW (AcquireTokenByUsernamePassword). I get the Token and I can access the site via Postman without any problems, but in my ...
Matthias's user avatar
0 votes
0 answers
23 views

Sharepoint C# Data Transfer Date Issue

I transfer data from one tenant list to another tenant list with c#. I'm passing the date columns into a string value. Received data; 3/1/2023 18:00 String value; 3/1/2023 18:00 Value written to the ...
Yunus Emre's user avatar
0 votes
1 answer
705 views

Get all Files and Folders and subfolders from a Root Site in a tree view with C# in a PNP Core Framework

I'm currently using PNP Core Framework with a "normal" console application. I want to get all Files and Folders from a specific Document Library. How can I do this in a simple way? I tried ...
Matthias's user avatar
0 votes
1 answer
941 views

CSOM PowerShell script - moving to modern authentication

I have a complex CSOM script that I need to get working for a Tenant that uses Modern Authentication. This works fine using Basic Authentication. Its not an automated script so an interactive login ...
user3844416's user avatar
0 votes
1 answer
543 views

CSOM vs PnP Core SDK vs Graph API, which approach is more future proof

We want to start a new project which include creating an azure function (using .net 6.0) that runs on timely basis to create folder structure as follow:- we have a SharePoint custom list which allows ...
John John's user avatar
0 votes
0 answers
32 views

Delete item after copy in csom

How should i modify below code so it delete the file test.spcolor from desUrl after ApplyTheme Web web = ctx.Web; ctx.Load(web); ctx....
kumar's user avatar
  • 139
0 votes
2 answers
1k views

Use CSOM with Secret to integrate with sharePoint Online

I found this video on YouTube which show how to use PnP core inside Azure Function to integrate with SharePoint Online @ https://www.youtube.com/watch?v=9erhWdwbkq8&t=543s but can i have the same ...
John John's user avatar
0 votes
0 answers
39 views

{"The 'colorPaletteUrl' argument is invalid."} System.ArgumentException

I am getting below error while applying theme from my folder where i uploaded the spcolor file It is working fine with below code string siteUrl = "https://xxxxx.sharepoint.com/sites/...
kumar's user avatar
  • 139
0 votes
0 answers
23 views

CSOM Search for documents

I am using search API to search keyword for documents (pdf, word) but the result returned contains only the document Title and path...etc I want to return the Paragraph which contains the search ...
booody's user avatar
  • 3
0 votes
1 answer
112 views

How to add multiple RoleDefinitions to RoleDefinitionBindingCollection?

Why I can't add multiple role definitions to a RoleDefinitionBindingCollection? Always only the last role is added. Why? Its, a collection of roles, or? $group = Get-PnPGroup -Identity "MyGroup&...
sp00ky's user avatar
  • 27
0 votes
1 answer
89 views

Right User Permissions to use ListItem.GetUserEffectivePermissions method

I'm currently using a SharePoint account as a Service account to get files and share them in an application I'm working on using CSOM. I filter the files according to the logged-in user to check if ...
Ahmad Adel's user avatar
0 votes
1 answer
231 views

replace PnP.Core.Services with CSOM for our Azure Function which uses .net 6.0

I have an Azure Function which uses PnP.Core.Services to interact with SharePoint to create a list item. The Azure function is based on .net version 6.0. I have this startup.cs:- using Microsoft.Azure....
John John's user avatar
1 vote
0 answers
101 views

CSOM Updating List Item in Large List throws Threshold Error

Background: Have a large document library (25K+ Documents) in a SharePoint Online Website. We migrated this Document Library from SharePoint 2013. This library has a few MetaData Lookup columns ...
ckas's user avatar
  • 11
1 vote
1 answer
255 views

CSOM vs PnP Core inside our Azure Functions

I want to write an Azure Function deployed inside Azure and which run on timer schedule. but i am not sure which library i should user, either:- CSOM PnP Core what are the main differences and when ...
John John's user avatar
0 votes
1 answer
24 views

'SharePointTheme' does not contain a definition for 'customtheme'

I am trying to apply custom theme to my site collection but getting below error while applying: Error CS0117 'SharePointTheme' does not contain a definition for 'customtheme' Below is my code line: ...
kumar's user avatar
  • 139
2 votes
0 answers
49 views

Remote Event Receiver - Declare Item as Record looses field values when declared (CSOM Provider Hosted Add-In)

this solution is in SharePoint 2016 On Premise. I have activated content approval on document libraries and the RER's I have in my app is handling these events: "ItemAdded" "...
Fredrik Johan Lund's user avatar
0 votes
0 answers
152 views

Project Server 2019 on premise: ServiceModel.CommunicationObjectAbortedException in Project Update queue job created using CSOM

I have a code that makes a few simple changes to a project using CSOM: projContext.Load(this.projContext.Projects, pj => pj.Where(p => p.Id == projId)); projContext.ExecuteQuery(); var proj = ...
Maxim Panasyuk's user avatar
0 votes
1 answer
124 views

Is there anyway to Disable or remove Shared Link for particular user in SharePoint Online using Rest API, CSOM or PNP

I am looking for some mechanism to remove a specific user from a ShareLink in SharePoint Online via Rest API, CSOM or PNP, whilst leaving the ShareLink active and available for other users. I want to ...
Mark's user avatar
  • 1
1 vote
0 answers
254 views

PNP app only authentication with certificate : The remote server returned an error: (401) Unauthorized.' category="invalid_client

I've been trying for age to use azure authentication with a certificate to retrieve a usable clientcontext to do some csom operation but not matter the method I try I always get the same error message ...
Hadri's user avatar
  • 11
0 votes
1 answer
1k views

AuthenticationManager does not contain a definition for GetAzureADAppOnlyAuthenticatedContext

I'm running into some trouble when trying to get a client context from PnP for an Azure AD app only connection. I'm trying to follow This tutorial on how to create an application that would run on a ...
Hallemon's user avatar
0 votes
1 answer
26 views

CSOM search fails on Integer fields

I have a very simple query: var where = "<Where>"; var decoded = decodeURIComponent(searchKey); where += "<Contains><FieldRef Name='Nr' /><Value Type='Integer'>&...
Emaborsa's user avatar
  • 1,189
0 votes
2 answers
177 views

SharePoint Add in Permissions for Search

I want to register an add in in SharePoint online where I can run search queries. I've tried various permission xml's and cannot seem to get it to work. I've been going here assign the xml... https://{...
N8ALL3N's user avatar
  • 101
1 vote
2 answers
6k views

Use SharePointOnlineCredentials in .net 6

I've been doing a lot of CSOM application for different clients, and have always been fine using SharePointOnlineCredentials to connect and do my things. However, I created a new project in .net 6 to ...
Hallemon's user avatar
1 vote
1 answer
202 views

Update Site Name which is connected to Office 365 Group using CSOM

I want to update Site Name using CSOM for SharePoint Site which is connected to Office 365 Group so at the end I want to update SharePoint Site Title and Office 365 Group Name both. I have tried CSOM ...
Kalpesh Vaghela's user avatar
0 votes
0 answers
258 views

CSOM Update and add using c#

i am trying to add items from one list to another list and able to add the items but how should i modify my code so if item exist in destination list update the item else create new entry ? I have ...
Ashok 's user avatar
  • 49

1
2 3 4 5
39