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
12 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 ...
0
votes
1answer
29 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 ...
0
votes
0answers
8 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 ...
0
votes
0answers
5 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 ...
0
votes
0answers
15 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 ...
1
vote
1answer
19 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?
0
votes
2answers
28 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 ...
0
votes
1answer
14 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 ...
0
votes
0answers
27 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 ...
0
votes
0answers
43 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 ...
0
votes
1answer
45 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: &...
1
vote
0answers
16 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 ...
1
vote
0answers
17 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 ...
1
vote
1answer
56 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 ...
0
votes
0answers
29 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" ...
1
vote
1answer
9 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; ...
0
votes
1answer
63 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....
0
votes
1answer
34 views

Caml Query - Unable to get data by date range

I have a list "List-A" which have an item with following details: StartDate: 2021-08-31T22:00:00Z [In list view- 09/1/2021, type- DateOnly] EndDate: 2021-09-29T22:00:00Z [In list view- 09/...
0
votes
0answers
26 views

CSOM Search API file Modified date incorrect

I am using the SharePoint CSOM Search API and it appears the Modified property is returning the documents metadata Modified date instead of the SharePoint Modified date you would see a collection view....
0
votes
1answer
22 views

how to insert item with attachments to normal list in office 365 using asp.net c#?

I am trying to add item to Office 365 list item, and I did use the below code: public string PostingDeliveryNote(string ProjectName, string SupplierName, string DN_No , string PONo, string ...
0
votes
2answers
37 views

CSOM CreateAnonymousLinkForDocument share url link

I am trying to generate Anonymous Share URL link(s) for documents using the following CSOM method: internal static string GetFileShareUrl(ClientContext spClientContext, string fileRef){ ...
1
vote
1answer
36 views

How to programmatically check if site permissions are modified?

I am working on building a report where I need the list of all the sites whose permissions got updated in the last 7 days or any specific period and we have some business logic to perform once we have ...
0
votes
0answers
12 views

Update File metadata not working on Modified Date or Create Date with Sharepoint CSOM

I have this code that uploads a file to Sharepoint Online and then tries to modify its metadata. FileCreationInformation newFile = new FileCreationInformation(); byte[] FileContent = ...
0
votes
2answers
75 views

How to update File metadata in Sharepoint CSOM?

I know this question has been asked in the past, but I can't seem to find a working solution. I want to update The CreatedDateTime, ModifiedBy and CreatedBy metadata on a file that I uploaded with ...
1
vote
0answers
55 views

How to use Web.EnsureUserByObjectId method in SharePoint Online CSOM

I wasn't able to find anything about this method. Does anybody know how it works? public User EnsureUserByObjectId(Guid objectId, Guid tenantId, PrincipalType principalType); As I can understand from ...
0
votes
2answers
40 views

Update Sharepoint List Item with Javascript Client Side Object Model

For the past days I've been trying, with no success, to establish a connection to a sharepoint list (https://mywebsite.com/sites/concasbkcu/Lists/list_teste/AllItems.aspx) and update its items with ...
0
votes
1answer
15 views

How do I build an external .NET search engine that utilizes SharePoint Search with advanced/dynamic filtering?

On my website I want to build a .NET Core application which invokes the SharePoint Online search engine (using REST Service) while also meeting specific filtering conditions regarding the managed ...
1
vote
1answer
59 views

addfieldasXML in PowerShell Exception

I've been playing around with adding fields to Sharepoint via PowerShell using XML. When I execute the code below it creates the field under the group but kicks out an error each and every time. Yet ...
0
votes
0answers
41 views

Prevent Guest Access when sharing document or folder

I am developing a tool for my company that allows people to share files from our network with clients in a very automated way to make sharing documents easier for everyone. However, I have run into a ...
0
votes
0answers
93 views

The term 'New-CsOnlineSession' is not recognized as the name of a cmdlet

strong text Hello, i try to enable webinar in teams powershell but when i try to use the cmd AllowMeetingRegistration true i have this message errour knowing that I am already connected via the ...
0
votes
0answers
8 views

How do I get SchemaXmlWithResourceTokens property of a field in SharePoint Online?

I am trying to see the custom field's description in other languages. When I use Get-PnPField in powershell, it does not bring any value for SchemaXmlWithResourceTokens property. Am I doing something ...
0
votes
0answers
32 views

Get Theme details of SharePoint site using CSOM

Is there way to get current Theme details of a SharePoint site using CSOM https://contoso.sharepoint.com/sites/siteA I read this and it doesn't have a method
0
votes
0answers
29 views

Project CSOM create users

Project Online has its own set of users, seemingly independent from SharePoint. Refer PWA Settings --> Manage Users. Via CSOM, these users are present in ProjectContext.EnterpriseResources ...
1
vote
1answer
24 views

How to return user email from a custom column "Owner" to an XML from sharepoint online list using CSOM?

How to return user email from a custom column "Owner" to an XML from SharePoint online list using CSOM? This works but bug exists as it sends Microsoft.SharePoint.Client.FieldUserValue[] ...
0
votes
0answers
16 views

Attempting to load ListItemCollection with DisplayName throws ServerException "Value does not fall within the expected range."

I have a CSOM process that extracts metadata from a SharePoint Online site and generically traverses the lists. A certain Link-based list is throwing a Microsoft.SharePoint.Client.ServerExeception of '...
0
votes
0answers
28 views

Latest example of how to authentication to SharePoint online CSOM using Microsoft.SharePointOnline.CSOM version 16.1.21312.12000

I used to login to SharePoint online using this c# code snippet: var sharepointOnlineCredentials = new SharePointOnlineCredentials(username, securePassword); var httpHandler = new HttpClientHandler(); ...
0
votes
1answer
243 views

Permissions for CSOM & SharePoint Online?

I'm working to upgrade an existing on-premises SharePoint site to a SharePoint Online site. The existing site uses a lot of code (both JS and .NET code) talking to the on-premises site via JSOM, CSOM,...
0
votes
1answer
42 views

SharePoint .Net CSOM Equivalent for Add-PnPFile

We have a requirement to use CSOM based .Net Managed Code to perform the upload file and set the metadata properties. However, we cannot upload and set the metadata properties simultaneously using ...
1
vote
1answer
102 views

CSOM SharePoint Search API filter files only

Using CSOM Search API is there a way to filter for only files? Something similar to the following ListItem filter would be ideal: ListItem.FileSystemObjectType.Equals(FileSystemObjectType.File) Ex ...
0
votes
1answer
26 views

How to get ListItemCollection.Files paginated results

I have the following method in place and trying figure out how to update for paginated results using int pageSize & int page parameters. Currently I have pageSize working using CamlQuery RowLimit, ...
0
votes
1answer
29 views

CSOM ListCollectionItems count based on folder path performance issues

I have a design requirement to get total count for ListItemCollection based on Files specified by Folder Path. I currently have the following code in place: using (ClientContext spClientContext = ...
1
vote
0answers
45 views

Fix 'Accept-Language' header for a CSOM request in PowerShell script

I'm trying to fix the language of a PnP PowerShell request. Specifically, I'd like to extract site scripts from a web in a neutral language. Here's what I tried : $cnx = Connect-PnPOnline -...
1
vote
0answers
29 views

Error while updating multi value User Profile Properties

I am using Bulk Import to update the multi-value user profile property. I am getting the below error. Property Names [TestLocation] are Taxonomic Properties The code works fine if I use any OOTB / ...
0
votes
0answers
44 views

SharePoint 2019 remote event receiver is not firing when receiver service is https enabled

From c# application using CSOM, I have registered events on a particular document repository. Also hosted a RemoteEventService a WCF service which implements IRemoteEventService and implemented ...
0
votes
1answer
298 views

CSOM - unlock file locked for shared use

I have an SPFX application where the user can visualise a number of files stored in SharePoint. The files are open on an IFrame on the left that points to Office Online while the metadata are ...
0
votes
2answers
31 views

Tag Multiple Files

My scenario : I have over 10k files in different sites. They all have the same content type (same amount of columns) and are found in folders/ subfolders. I need an effective and quick way to add the ...
0
votes
0answers
21 views

How to Show the Colored status or check icon based on column status (yes/no)

I have Custom List for Visitors and I created some custom columns: Visitor Name Enter Time Check Out Time Check Out Status etc.. Here I want when Status column value changes to Yes (this type is Yes/...
0
votes
1answer
24 views

File object created and modified property values vary from ListItemCollection and FileCollection

I noticed some differences in values when calling File obj Created and Modified properties from ListItemCollection and FileCollection. Details below: Below is some old code that fetched files from ...
0
votes
1answer
32 views

CSOM File object ID property

What is the correct way to initialize or call File obj ID property? I don't see it as a default object property. I also tried calling via: File.ListItemAllFields["ID"] That failed. I did ...
1
vote
1answer
32 views

Why does this code works? Calling executeQuery without Load [CSOM]

First question: Why we don't need ctx.Load(web) before defining the List? I see that we use web object in defining the List Second question: Why are we not calling ctx.Load() before ExecuteQuery ...

1
2 3 4 5
38