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
0answers
4 views

CSOM - ApplyProvisioningTemplate - Access denied. You do not have permission to perform this action or access this resource

I was using ApplyProvisioningTemplate function with PnP.Framework as below code for applying template . it used to work without an issue. but i randomly get the below error with following message . ...
0
votes
1answer
16 views

can any one provide complete script to compare csv file and SharePoint list column(People) and extract records not exist in SharePoint list

I have one excel file and a SharePoint list(Employee master). I want to extract the user in csv file who is not in the SharePoint list(Employee Master). If the employee not exists in SharePoint list ...
0
votes
1answer
17 views

How to find all subfolders inside a SharePoint Folder using PNP Framework

I want to find all the subfolders of a SharePoint folder using PNP framework. My current code is like this using (var cxt = new AuthenticationManager().GetACSAppOnlyContext(siteUrl, ...
0
votes
1answer
20 views

How i can secure ClientSecret for my app which i am using inside SharePoint asp.net console application

I have the following SharePoint asp.net console application, which runs each hour using windows tasks scheduler :- string clientId = "e***"; string clientSecret = "****"; string ...
1
vote
0answers
39 views

Working with large amounts of folders

I'm in SharePoint Online, where I have to copy data from one list to another. My code already works on low amount of folders, but I have problems with large amount of folders. Example: LibraryA: ...
0
votes
0answers
10 views

Is there GetFieldDefaults for class Microsoft.SharePoint.ClientDocumentManagement.MetadataDefaults

I am trying to retrieve the value after first setting a default for a field at a location using the method SetFieldDefault(SPFolder, String, String). The reason for this is we are finding that some of ...
1
vote
1answer
43 views

Azure Function - SharePoint CSOM call with currently signed in user

I have a azure function and making a CSOM call to SharePoint online. The authentication was done with App ClientId & ClientSecret. Everything working fine. I am capturing a DocSet version via CSOM ...
1
vote
1answer
20 views

How to fetch all the document libraries into a FolderCollection for SharePoint Online C#

I am trying to get the name of the document libraries of SharePoint online into a FolderCollection using the below code. But it looks like I am not getting the display name of "Documents" ...
0
votes
0answers
16 views

CSOM code to loop through all groups and users assigned inside an item and grant them Read permission

I have the following code to define a unique permission for a list item and iterate over all the groups and users assigned to the item, as follow:- ListItem listItem = context.Web.GetList(context.Web....
1
vote
1answer
20 views

SPO CSOM Powershell manage folders with # and % in the name

I'm writing a CSOM PS script to create folders in a doclib, and set permissions on them. Anything works fine except when the folder name contains a % I am able to create the folder using ResourcePath, ...
3
votes
0answers
67 views

I am no longer able to debug/run my SharePoint Remote Event Receiver locally using Ngrok

Last month the below steps were working well for me to debug and test a SharePoint online remote event receiver locally:- Open Ngrok.exe >> run the following command inside ngrok:- ngrok ...
1
vote
1answer
34 views

Upload a file in any specific subfolder of sharepoint online C# (CSOM)

I am trying to send a file (Test.docx) to a specific folder under document library in sharepoint online. The folder name is "new" which is under a "Test" folder i.e. Documents/Test/...
0
votes
1answer
33 views

How to get/update all user profiles via CSOM?

I need to get and update user profile properties in SharePoint Online via CSOM using App only permissions. I am using .NET core CSOM. App is registered via appinv.aspx page. Permissions: <...
0
votes
0answers
22 views

ClientContext gives 401 unauthorized for AccessToken from https://login.microsoftonline.com/{tennant_id}/oauth2/token

I'm using CSOM APP-only auntentication method to connect with SharePoint in a .Net Core Application using MicrosoftSharePointCSOM package and not PNP packages. Problem- I'm using below endpoints to ...
0
votes
1answer
24 views

Inside CSOM why I can populate a “People or Group” field using User object while I can not populate a “Managed Metadata” field using Term object

Inside my CSOM code, I can populate a "People or Group" field using User object, as follow:- var technician = context.Site.RootWeb.EnsureUser(SQLitem.Technician); context.ExecuteQuery(); ...
0
votes
0answers
16 views

Context.ExecuteQuery() will raise this error:- “System.NullReferenceException: 'Object reference not set to an instance of an object.”

I have the following CSOM code inside my asp.net core console application:- TaxonomySession txSession = TaxonomySession.GetTaxonomySession(context); TermStore tc = txSession.TermStores.GetByName(...
1
vote
0answers
21 views

GraphAPI send invitation to external/guest user for a specific SharePoint site

Language: JavaScript - MSAL library Scope: GraphAPI Is there a way to send an invitation to an external user thorough GraphAPI that will be valid only for a specific site. Currently I am using the ...
0
votes
1answer
29 views

Can we use CSOM inside .NET 5.0

I have created a new .NET 5.0 core console application >> but i am not sure if currently CSOM is supported inside .NET 5.0 ?
0
votes
1answer
25 views

Approaches to integrate our Service Desk system with SharePoint Lists

We have a Service Desk system and using its REST API and on other Scenarios using its Database we need to fetch data from the Service Desk system and populate SharePoint lists. so I am trying to find ...
0
votes
2answers
17 views

Operations on a ContentTypeCollection object throwing an unexpected exception

I am developing a Console application to programmatically download documents from a SP site among other things. I am trying to retrieve the fields of a content type of a SP list using CSOM : using (...
0
votes
0answers
27 views

CAML Query to filter out document sets based on values of Content Type

I have a document library with document sets that have Content Type (Name of Content Type is "FruitCategories") columns as "FruitName" (single line of text), "FruitPrice" ...
0
votes
1answer
30 views

Setting “Site sharing settings” programmatically

I am trying to programmatically set the "Site sharing settings" options under "Site Permissions" -> "Change how members can share" screen on a Modern site. I would ...
0
votes
1answer
29 views

SharePoint Online - Add site collection admin using CSOM PowerShell

I have one SharePoint site e.g. test1 - "https://abc.sharepoint.com/sites/test1". I have granted SharePoint Administrator role to User1 in the Microsoft 365 Admin Center (Note - User1 does ...
0
votes
0answers
34 views

How to block files from downloading and not allow editing in CSOM

I want to set all files in a specific folder to "block from download" and "disallow editing". Just a simple automated process so it saves me time having to manually set each and ...
0
votes
1answer
16 views

Getting all shared files and folders from a given site

Is it possible to get all files or folders that has been shared from a site in one batch, or do you need to iterate each single file and folder on the site?
0
votes
1answer
13 views

powershell query row limits for SharePoint online

I am not a super scripter, but I have a requirement run a search query over a site with multiple libraries. The query is for all documents where a specific string (someone's name) appears. I have 2 ...
0
votes
0answers
15 views

Adding LastItemUserModifiedDate to an array in Sharepoint Online

I am currently working on a script that will loop through every site with the site status "Unlock" and display the details of the last time the site was modified by a user. In the future I ...
0
votes
0answers
13 views

In CSOM how to remove values from FieldUserValue[] field

In CSOM how can I remove values from FieldUserValue[] field. Here is my current code: FieldUserValue[] finalApproverColl = (FieldUserValue[])ApprovalItem["FinalApprovers"]; if (ApprovalItem[...
0
votes
0answers
6 views

Add navigation link 'old school' to a Hub menu

I know how to do it with PnP, but I would like to do it wit classic CSOM. The Hub menu is not part of the Web.Navigation object, like the the QuickLaunch or the TopNavigationBar,
0
votes
0answers
24 views

Project Server - Updating notes on a task through REST/CSOM

I've been racking my brain over this for a while and Googling has failed me so I was hoping I could get some help here. I just want to be able to update the Notes field on a Project Task in Project ...
1
vote
0answers
19 views

Updating calculated field formula via CSOM with non-english regional settings fails with “The formula contains a syntax error or is not supported.”

In our current project we programmatically provision site collections, site columns and content types using CSOM/PnP. During this provisioning process the initial locale id is switched from 1033 to ...
0
votes
1answer
23 views

Can we disable remote event receiver from firing inside remote event receiver

I am writing a remote event receiver for our online custom list, and the RER itself do some updates to the item been added/updated, where this is causing my RER to keep firing. so is there a way when ...
0
votes
1answer
56 views

Adding security group via EnsureUser failed: 'The specified user could not be found'

target: SharePoint Online, Azure AD code environment: Azure Functions, .Net Core goal My goal is to ensure a user to a SharePoint site programmatically (via CSOM) and this user is a Security Group. ...
1
vote
1answer
25 views

Make a rest csom call - error in body

I'm using a flow http request and wish to update a sharepoint column with the following uri: _vti_bin/client.svc/ProcessQuery It all works , but when i try to add html tags, <a href="https://...
0
votes
0answers
24 views

SharePoint High Trust some users getting 401

Hi I've created a High Trust application, but some users seem to be getting the 401 from time to time. I've got a hunch that it's down to them not logging off and something not 100% accurate with ...
0
votes
1answer
26 views

Retrieve SharePoint 2010/2013 workflows in SharePoint 2013 using CSOM

I need to write CSOM Code to retrieve SharePoint 2010/2013 workflows. I am able to get 2013 workflows only. Below is the code: WorkflowAssociationCollection workflowcollection = list....
0
votes
0answers
204 views

C# CSOM PnP AuthenticationManager Connection Issue

Environment: SharePoint Online (Office 365) Visual Studio 2019 .NET Framework 4.5.2 SharePoint PnP Core Online 3.8.1904 Microsoft SharePoint Online CSOM 16.1.8715.1200 I created a console ...
0
votes
2answers
39 views

Proper format for username when passing credentials to SharePoint online in CSOM

I'm trying to connect to SharePoint online to read list data. Problem - I need to use a service account since these accounts have passwords. The credentials class needs a password and our user ...
1
vote
1answer
22 views

server error access SharePoint vm

Have anyone tried to connect Sharepoint url to access sp vm hosted on azure through C# CSOM using (ClientContext ctx= new ClientContext(siteurl)) { ............ . . . . . .. . . . ctx.Load(web); ctx....
1
vote
2answers
34 views

Inside CSOM what does Web.SiteUsers include exactly

I am a bit confused on what does Web.SiteUsers include in CSOM? as per the documentation it includes the users which belong to a site collection, but what does belong mean? Does it mean users who have ...
0
votes
1answer
14 views

How to authenticate sharepoint 2013 by FedAuthCookie in .netcore3.1.0

I am developing web application in .net core 3.1.0, for that i have to get documents stored in sharepoint 2013 using CSOM, the sharepoint app authenticates by FedAuthCookie. In this Microsoft docs, it ...
0
votes
0answers
11 views

Clear resource field value via CSOM

I'm trying to sync resource data from an external system to Project Server 2019 using C# and CSOM but I cannot find a way to clear TerminationDate value of an EnterpriseResource. The property is non ...
0
votes
2answers
43 views

Using CSOM can i ensure the user using the login user id instead of the login username

I have the following CSOM code inside my remote event receiver: ListItem listItem = context2.Web.GetList(context2.Web.ServerRelativeUrl + "/lists/Assets").GetItemById(listItemID); context2....
0
votes
1answer
80 views

How to download all of the files under a specific folder using CSOM from SharePoint Online?

I have a folder structure similar to this on our SharePoint Online site: Documents/ Drawings/ For Review/ Released/ Archived/ Documentation/ For Review/ ...
0
votes
4answers
57 views

Authentication with SharePoint Online in Microsoft 365 and simple console application

I need your help with my small application. I need to create easy console application which will sign into SharePoint Online and download some documents from library. When I am doing this on older ...
1
vote
1answer
43 views

Is it possible to set a property bag value via CSOM without having tenant permissions?

I'm trying to use my backend CSOM app with context of Site Collection Administrator service account to programmatically set a property bag value to store some settings for my frontend extension app. I'...
0
votes
2answers
32 views

$context.web.contenttypes is null | CSOM & PowerShell

I am trying to get a list of content types with PowerShell using CSOM. I was able to get list of fields, however when I try to get a list of content types, it's empty.. here's the code am using: $...
0
votes
1answer
24 views

Get outgoing email settings for current web application via REST or CSOM?

I am working on a SP2013 workflow custom code activity to allow sending an email with attachments, where the email attachments are the SharePoint attachments of the current list item. I got some proof-...
1
vote
0answers
83 views

Getting ClientContext in SharePoint CSOM

I am developing several Azure Functions using the CSOM API for SharePoint. The main functionality is creating PDF's for various purposes and uploading these to SharePoint with CSOM. I have followed ...
0
votes
1answer
21 views

How to use CSOM, SOAP or Rest API to detect anonymous views of list items for a List?

Let's say I have a SharePoint site with anonymous view enabled for the entire website But I have a List that breaks role inheritance. How do I use CSOM, Rest API or SOAP API to detect if a List has ...

1
2 3 4 5
37