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
1 answer
15 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&...
  • 1
0 votes
0 answers
11 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 ...
0 votes
1 answer
17 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....
  • 251
1 vote
0 answers
23 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 ...
  • 11
1 vote
1 answer
54 views
+100

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 ...
  • 251
0 votes
1 answer
18 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: ...
  • 111
2 votes
0 answers
38 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" "...
0 votes
0 answers
26 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 = ...
0 votes
1 answer
19 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 ...
  • 1
0 votes
0 answers
14 views

How to get List of items from Root folder filtering by ID when you click on hyperlink ID column in SharePoint using CSOM in C#

I have on site SharePoint site which shows all List of customers with customerid column which is hyperlink the URL:http://apps/sites/cap/Lists/ArchiveProducts/AllItems.aspx. When I click the hyperlink,...
  • 101
1 vote
0 answers
63 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 ...
  • 11
0 votes
1 answer
493 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 ...
0 votes
1 answer
13 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'>&...
  • 1,190
0 votes
2 answers
41 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://{...
  • 101
1 vote
1 answer
983 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 ...
0 votes
0 answers
6 views

Is it possible to interact with Project Server data from a Project Server server-side event handler?

I have MS Project Server running on a SP 2016 on-prem SharePoint farm. I have set up server side event handlers for the OnPublishing and OnPublished events. Everything is configured correctly for ...
  • 12.5k
0 votes
1 answer
64 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 ...
0 votes
0 answers
9 views

Client side object model version of SPWebApplication Class and SPContentDatabase Class

SPContentDatabase Class and SPWebApplication Class are from the assembly Microsoft.SharePoint.dll, is there a CSOM alternative for these two classes that? I am trying convert SSOM code to CSOM, ...
0 votes
0 answers
18 views

Identifying a file by name from a folder link ad downloading it in C#

I am very new to the C# CSOM api for SharePoint, but I am interested in creating a program that uses it. I currently do software updates from a central server, but I would like to move them onto ...
0 votes
0 answers
113 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 ...
  • 47
0 votes
0 answers
88 views

How to compare two Sharepoint Lists and add Item from one list into the other one?

I've tried to compare two SharePoint Online lists. Both of them have an "email" as list item and if the email is equal then it should import the list item "Steuernummer" (German ...
0 votes
1 answer
91 views

Null exception in Web.EnsureUser CSOM C#

How can handle null exception while copying item from source to destination list as MGR and Account may have users which are not available in organization var employee = contextDestination.Web....
  • 47
0 votes
1 answer
143 views

How to update in SharePoint list using CSOM?

I have written below line which create item in destination list but would like to check if item exist update the column else create new item my Title field is primary key for source & destination ...
  • 47
0 votes
1 answer
160 views

Issues with SharePoint Online OAuth 2.0 & Lack of proper documentation

My end goal is getting an access token with which I can communicate to a SharePoint site and manage lists via CSOM (mostly upload documents into lists). I also need a refresh token to manage ...
1 vote
1 answer
68 views

Attempted to access an unloaded appdomain

I wrote the following code some years ago (or maybe I took it from the web, don't remember): protected static CustomUser GetSiteUser(IIdentity identity, string siteUrl) { using (...
  • 1,190
0 votes
0 answers
12 views

How to get a list of errored workflows

Is there a CSOM (SP 2013) way to find out all the errored workflows from a given site? I have the following but it's server side code. $subdomain = read-host "Enter the Client subdomain only"...
0 votes
1 answer
70 views

Permission Masks

Is it possible to get permission masks and type using csom? The following web service /_vti_bin/Permissions.asmx?op=GetPermissionCollection looks to return what I am looking for. However I can't use ...
  • 935
0 votes
0 answers
25 views

Download files with accented characters using SharePoint Client Object Model

by using SharePoint Client Object Model I'm not able to execute Microsoft.SharePoint.Client.File.OpenBinaryDirect() to open files with accented characters (eg https://sharepoint/sites/root/doclib/...
1 vote
0 answers
46 views

Customizing Document ID in SharePoint Online using a background process

I'm looking to use a custom formula for generating a document ID in SharePoint online. Each document will have: A three letter project code, defined by the "Begin IDs with the following ...
  • 111
0 votes
0 answers
56 views

SP on prem - CSOM/REST api to get *only* unique permissions from a list

I am building an ACL tree for my sharepoint collections via the REST/CSOM api. For a given list, I want to get all unique role assignments from that list. But I do NOT want to list each item in the ...
0 votes
1 answer
57 views

SharePoint CSOM List Allow Multiple Selections on a choice Column?

How can I set Allow multiple Selections to ON on a Choice column in SharePoint list using CSOM or Graph API? I can't seem to find a way to do it. Here's the setting that I need to turn on.
0 votes
0 answers
9 views

Workflow Manager custom code activity - Exception in one run causes subsequent run to fail early

I have a custom workflow code activity that uses CSOM to reach back into SharePoint. It worked fine using Classic/Windows auth. We recently switched to claims auth, so I had to adjust the code to ...
  • 12.5k
0 votes
0 answers
8 views

CSOM with claims auth - attempt to open a second file times out

I have some CSOM code that I had to switch over to using claims auth. The code makes several calls to Microsoft.SharePoint.Client.Utilities.Utility.ResolveUserPrincipal(spCtx, other args...); spCtx....
  • 12.5k
0 votes
0 answers
28 views

How to get a FedAuth cookie in 2013/2016 without username or password, using the implicit identity that is executing the code?

The problem I'm trying to solve: I have a custom workflow code activity written in .NET 4.6.1 running in Workflow Manager. The custom code activity uses the .NET CSOM to reach back into SharePoint. ...
  • 12.5k
0 votes
2 answers
842 views

Connect to SharePoint Online from our console application when the "DisableCustomAppAuthentication is set to true"

We have a lot of .Net console applications which run inside windows on-premises servers, which connect to SharePoint online using ClientID & ClientSecret and perform some background tasks, as ...
  • 251
0 votes
0 answers
32 views

Drawbacks and disadvantageous of setting "DisableCustomAppAuthentication to false" inside our tenant [duplicate]

We have a lot of .net console applications which run inside windows on-premises servers, which connect to SharePoint online using ClientID & ClientSecret and perform some background tasks, as ...
  • 251
0 votes
0 answers
39 views

Threshold error inside our CSOM code

I have the following code inside a .net console application, to get 4999 items from a custom list and add them inside a list named customerLiveOrderAllItems to implement paging, as follow: var omsWeb =...
  • 251
0 votes
3 answers
42 views

How to detect enabled QuickEdit on a List or Library from client?

When trying to enforce certain business rules on list Forms, there's always the risk that users will use QuickEdit to circumvent them. Is there a way to detect if QuickEdit is enabled (or whether this ...
0 votes
1 answer
201 views

Getting null value of PContextFactory through dependency injection

I am not able to get value of PContextFactory through dependency injection. below are the code. Startup.cs using System; using System.Diagnostics.CodeAnalysis; using System.Linq; using System....
0 votes
0 answers
27 views

Sharepoint CSOM GetChanges API : How to detect item checked out/in?

We have a requirement where we need to programmatically detect whenever any items in a list have been checked out/in. I am currently using Sharepoint CSOM List.GetChanges API. It returns a ChangeItem ...
0 votes
1 answer
75 views

SPO Retrieve Site Properties returns empty or '00000000-0000-0000-0000-000000000000' Sensitivity Label in SiteProperties class

I'm trying to get all site collections (including it's properties) under a SPO Tenant with below piece of code: SPOSitePropertiesEnumerable sites; List<SiteProperties> ...
1 vote
0 answers
108 views

Extract files and folders from SharePoint 2013 document library to local folder

We have a SharePoint document library inside SharePoint 2013 on-premises. the document library contains around 1 TB of files and folders. now we want to extract those files and folders from SharePoint ...
  • 251
1 vote
1 answer
172 views

Downloading library files options as external user

I'm a member of a SharePoint site as an external user and have access to a document library with lots of files/folders. I want all of this content downloaded for offline usage and sharing. I'm unable ...
0 votes
0 answers
8 views

When uploading a large directory to sharepoint, api CAML queries do not seem to find the data?

I drag-and-dropped a folder into a document library in SharePoint 2019 on prem. The instance is a test instance, but has decent server size. It was pretty big, 30k files, 5k folders. max nesting is ...
1 vote
2 answers
885 views

Getting the Graph ID for a SharePoint document using the CSOM or REST api?

If we are crawling sharepoint online, we can access these data from API using: MS graph API or SharePoint REST API (CSOM, ODATA) All of our code uses the CSOM rest API for SharePoint. But, for each ...
0 votes
1 answer
48 views

Listing all sub-sites that you have access to in a site collection

In my situation, I have a site collection `/sites/mysitecol` - site collection - `/sites/mysitecol/test1` - sub-site - my user has access to this site. - `/sites/mysitecol/test2` - sub-site - my ...
0 votes
1 answer
174 views

How to retrieve all managed properties using csom or powershell in SharePoint online?

I want get a list of all custom managed properties from the SharePoint online site. Is there any way to get it using managed csom(c#) or powershell? Thanks in advance..
1 vote
1 answer
152 views

Delete SharePoint Modern Page comments using PowerShell

I have a Site Pages library in Communication Site. I have to delete comments posted by 2 users on all the pages using PowerShell. There are many solutions available which use REST but I prefer to use ...
  • 337
0 votes
0 answers
90 views

Sync between database tables and SharePoint online lists using ODBC. best approach to do so

We have 5 tables inside a database and we want to sync the data inside those tables to SharePoint online 5 lists. The database tables can be accessed using ODBC. So what are the approaches we have to ...
  • 251
0 votes
1 answer
79 views

Can I use a Claim variable and pass it into CSOM or PnP calls?

In my asp.net Core webapp, I'm putting the following into Startup.cs: public void ConfigureServices(IServiceCollection services) { services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)...

1
2 3 4 5
39