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
13 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 ...
user avatar
  • 101
0 votes
0 answers
8 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 ...
user avatar
0 votes
1 answer
10 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.
user avatar
0 votes
0 answers
5 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 ...
user avatar
  • 12.2k
0 votes
0 answers
10 views

Check a permission levels base permissions

I am trying to check that a site's default permission levels (Read, Edit, etc.) haven't been modified. I would like to find a way to check that they have certain base permissions enabled (...
user avatar
  • 1
0 votes
0 answers
5 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....
user avatar
  • 12.2k
0 votes
0 answers
12 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. ...
user avatar
  • 12.2k
0 votes
2 answers
95 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 ...
user avatar
  • 948
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 ...
user avatar
  • 948
0 votes
0 answers
28 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 =...
user avatar
  • 948
0 votes
3 answers
29 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 ...
user avatar
0 votes
1 answer
25 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....
user avatar
0 votes
0 answers
15 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 ...
user avatar
0 votes
1 answer
39 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> ...
user avatar
0 votes
0 answers
26 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 ...
user avatar
  • 948
1 vote
1 answer
53 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 ...
user avatar
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 ...
user avatar
0 votes
2 answers
195 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 ...
user avatar
0 votes
1 answer
27 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 ...
user avatar
0 votes
1 answer
51 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..
user avatar
1 vote
1 answer
58 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 ...
user avatar
  • 317
0 votes
0 answers
39 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 ...
user avatar
  • 948
0 votes
1 answer
35 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)...
user avatar
0 votes
0 answers
8 views

Disable Columns (ReadOnly) based on value another Column (customizing out of the box list form)? Which model would be better? SSOM/CSOM/JQuery

I want to disable all the fields when a Person marks a column/field as complete. However I am afraid the client might be able to change the JQuery/Javascript code upon inspection. So what are steps ...
user avatar
0 votes
1 answer
25 views

Is it possible to run CSOM code to cancel workflows? (SP 2013 )

I have the following code from previous job and it worked perfectly b/c I was the SP admin and had SP Server access. Now I dont have SP server access. $web = Get-SPWeb "https://inside.nov.com&...
user avatar
0 votes
0 answers
39 views

SharePoint online added with "Link to Document" type download the page instead of redirecting to set link

The CSOM code successfully upload a "Link to Document" document under provided library. However, when I click the title of the document, it downloads the .aspx file for the same. The actual ...
user avatar
0 votes
1 answer
10 views

Is it possible to use CSOM powershell and pnpsharepoint2013 from desktop?

Environment: SharePoint 2013 Do I need to be on the SharePoint Servers in order to run CSOM and pnp from desktop PC? Can anyone please suggest and a good link. I tried and it's not working. Kayla
user avatar
  • 15
0 votes
0 answers
18 views

SharePoint Online - Enable Scheduling via CSOM on Modern Pages (Site Pages)

Now, we can enable Scheduling on Modern Site Pages: https://support.microsoft.com/en-us/office/schedule-a-sharepoint-page-or-news-post-to-go-live-at-a-specific-time-4b81873c-9bbc-4307-b7ea-...
user avatar
0 votes
2 answers
17 views

How to determine if a RoleDefinition grants read access or not?

I have the role definitions like this: https://YOUR_TENANT.sharepoint.com/sites/YOUR_SITE/_api/web/roledefinitions So this will return something like: {_ObjectType_=SP.RoleDefinition, _ObjectIdentity_=...
user avatar
0 votes
1 answer
183 views

How to move from basic to modern authentication in my existing CSOM powershell script?

I have a big CSOM powershell script which is using basic authentication. This script is scheduled to run every day. This script is using credentials of a serviceaccount without MFA. We would like to ...
user avatar
  • 47
0 votes
0 answers
15 views

SharePoint 2013 CSOM

I only have site collection level access to all the sites. Is it possible to install CSOM on my desktop and run powershell against SharePoint 2013 on prem? If yes, where can I get some guidance on how ...
user avatar
0 votes
0 answers
26 views

Can't connect to Project Server

I'm trying to connect to Project Server (SharePoint 2016) using C# CSOM string siteUrl = @"http://<host>/pwa/"; string username = @"<user>@<domain>"; ...
user avatar
0 votes
1 answer
93 views

CSOM Folder.listItemAllFields won't load the item (Sharepoint Online)

I have been trying to load the item version of a folder via csom for some time now, but no matter how hard I try, it just won't load. For example : here's one of the configuration I have tried ...
user avatar
0 votes
1 answer
99 views

(401) Unauthorized error while accessing the Tenant details

I am trying to access SharePoint tenant details and able to get an accessToken using Oauth2 flow. then I used this token with CSOM to get tenant details as below. but I get 401 error . is there any ...
user avatar
0 votes
1 answer
44 views

Programmatically check whether employee/user left the orgnization

We have sharepoint online site. We have one console application written in CSOM which send emails to users. We want to exclude users who left the orgnization. How can we identify user left the ...
user avatar
  • 3,087
0 votes
0 answers
21 views

How do I download files from a shared folder SharePoint link with MFA?

I know you're supposed to use client ID en client secret for authentication. But obviously I don't have these since it's a shared folder. How do I still download files from a shared folder through a ...
user avatar
0 votes
0 answers
8 views

Checking ListItem type using Microsoft.SharePoint.Client

I have a collection of ListItems within a ListItemCollection and I need a reliable way of checking whether the ListItem is a Page or Document. I'm not sure which properties to access in order to check ...
user avatar
  • 13
0 votes
0 answers
33 views

How to Authenticate to Sharepoint Online Programatically In C#?

i am unable to authenticate to SharePoint online niether CSOM or AppOnly with clientid/cientSecret (appregnew.aspx,appinv.aspx) CSOM connection shows me the sign in username or password isnt one of ...
user avatar
  • 1
1 vote
1 answer
53 views

SharePoint Online C#/CSOM configure the list form

Is there any way via C#/CSOM to set custom JSON formatters for form, I mean the Configure the list form?
user avatar
0 votes
2 answers
30 views

Reduce Number of Server Round Trips in Query of SP List Item Tax Field Value Collection for SharePoint Online

I have the following CSOM running as an Azure Web Job which retrieves a list of the Taxonomic Terms for each SP List Item. It works but its very slow for list items with a lot of terms. This causes ...
user avatar
0 votes
1 answer
17 views

Bulk User profile updates using CSOM

I have an Active Directory sync app which is using for internal purpose and its saving the data to SQL table feeding from Azure AD via Graph API. Along with its basic functionality, we are updating ...
user avatar
  • 395
0 votes
0 answers
41 views

SharePoint Online CSOM/JSOM Get all root folders from Document Library and its all ItemChildCount (items including inside respective subfolders)

We have document library having records more than 25000 items including many folders. Using CSOM/JSOM need to get all root folders from Document Library (having more than 5000 items) and its all ...
user avatar
  • 399
0 votes
0 answers
106 views

Retrieving and Moving Files in a Folder with more than 5000 files in it using C#

I currently have a folder with more than 5000 files in it, so when I open the folder to view the files inside it through the UI I get the classic "The attempted operation is prohibited because it ...
user avatar
0 votes
1 answer
516 views

The remote server returned an error: (403) Forbidden Error

I am developing a C# console application. My target SharePoint server is SharePoint Online on Office 365. I am trying to get the URL of the file present in the SharePoint. I am getting an error: &...
user avatar
1 vote
0 answers
20 views

Track the recently Modified Sites in SharePoint Online

I am working on the console where I need to prepare the list of all the Sites in the tenant which were modified in last 24 hours or given timeframe. I tried to use the Tenant.GetSitePropertiesByUrl ...
user avatar
1 vote
0 answers
27 views

I am trying to return all lists from SharePoint site using CSOM, but my query only returns back 1 item

I'm new to the share point API. I am attempting to retrieve all the lists in a SharePoint subsite so that later I can choose one of the document libraries and upload a file. When the query finishes it ...
user avatar
1 vote
1 answer
200 views

How to get Shared by and Shared To properties of Sharing links from a document from SharePoint Online using CSOM C#

We have a requirement to retrieve all sharing links from particular document of document library via SharePoint CSOM C#. We are able to get Anonymous sharing links and Organization Sharing links using ...
user avatar
0 votes
0 answers
64 views

CSOM Error when trying to get all Fields in a site collection

I'm trying to get all the fields in a given site collection using CSOM. I grabbed the code below and gave it a try but I get the error Exception calling "ExecuteQuery" with "0" ...
user avatar
  • 75
1 vote
1 answer
11 views

Unable to show the lookup field in datagrid view using CSOM sharepoint online

private void btnGetdata_Click(object sender, EventArgs e) { try { string WebUrl = this.listUrl.Text; string lib = this.txtLib.Text; ...
user avatar
0 votes
1 answer
116 views

Updating a Script Editor web part's snippet contents via PowerShell & CSOM is failing

I used code from this site, which updates the title of a web part, so the change needed is perhaps minor. The code that isn't working: Write-Output $webPartDefinition.WebPart.Properties.FieldValues....
user avatar
  • 111

1
2 3 4 5
38