We changed our privacy policy. Read more.

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
6 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
16 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
27 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
34 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
10 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
37 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
39 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
39 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
14 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 ...
0
votes
1answer
22 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
40 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
18 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
5 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
27 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
20 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
20 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
13 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
20 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
72 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
30 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
28 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
23 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
20 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
28 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
26 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
102 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
20 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
20 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
20 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
27 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
31 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 ...
0
votes
0answers
37 views

CSOM - .Net Core 3.1 - Getting access denied from the last context.ExecuteQuery(); when trying to create a sub web

Everything else works perfectly. Why am I getting an access denied when trying to execute this code ? string password = "password"; var securePassword = new System....
0
votes
0answers
18 views

Copy file and return meta data

i want to ask how to make return meta data especially GUID after copy or move data via csom? im using MoveCopyUtil.MoveFile(this.clientcontext,srcUrl,DstUrl,true,options); i have source url as ...
0
votes
0answers
39 views

Check if content editor or script editor web part is present in the list forms (New/Display/Edit form) using PowerShell (CSOM/PnP)

I am trying to check if the content editor or script editor web part is present on the list forms (NewForm, EditForm, DisplayForm) in SharePoint 2013. I can get the web part type from web part page ...
0
votes
0answers
30 views

You cannot load dependent objects for more than 1000 resources. Use a filter to restrict your query

I have on-premise SharePoint 2019 and MS Sql Server 2019. I use CSOM to set actual work for resources. public TimePhase getResourceTimePhaseAssignments(EnterpriseResource resource, DateTime startDate, ...
0
votes
0answers
15 views

Trigger an update on documents

We would like to trigger an update documents so they will be included in labeling in the compliance center. Is there a minimum call you can make to trigger an update on a document without changing ...
0
votes
0answers
39 views

CSOM-Sharepoint online console app c# 'ServerVersion' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'

I am developing a simple code to retrieve item from Sharepoint online List. But on debug, I found an exception is thrown saying ServerVersion 'ServerVersion' threw an exception of type 'Microsoft....
0
votes
0answers
34 views

ServerRedirectedURL has no value

Do you have any idea on what maybe the reason why I am getting empty string when using GetWOPIFrameUrl, also having null values on ServerRedirectedURL, ServerRedirectedEmbedURL, and ...
0
votes
0answers
22 views

Executing a CAML query will return this error: "Specified argument was out of the range of valid values. Parameter name: index"

I have the following code inside our console application, to loop through a list of number and query the SharePoint list which is inside a modern communication site: foreach (var r in allrequests....
0
votes
0answers
18 views

Microsoft.IdentityModel.SecurityTokenService.RequestFailedException: Token request failed

I have a .net console application which have this CSOM code:- using (ClientContext context = new PnP.Framework.AuthenticationManager().GetACSAppOnlyContext(RisksiteUrl, clientId, clientSecret, ...
0
votes
1answer
19 views

How to CheckOut, Update and CheckIn a new version of an existing Sharepoint Document in C#

I'm using C# CSOM to add documents to a Sharepoint library. I'm using the code below which works. How do I modify this code so that if the Document already exists in Sharepoint it will CheckOut the ...
0
votes
1answer
42 views

Get all content and child content inside a folder using sharepoint PNP framework

I can get all contents inside a SharePoint list like this: List list = oWebsite.Lists.GetByTitle("Documents"); ListItemCollection Items = list.GetItems(CamlQuery.CreateAllItemsQuery()); ...
0
votes
1answer
45 views

Bind a lookup field to a dropdown in Provider Hosted App SharePoint Online using CSOM/C#

I am trying to bind a lookup column named team to an asp.net dropdown and the dropdown renders blank HTML <asp:DropDownList ID="team" runat="server" AutoPostBack="true"...
0
votes
0answers
38 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
26 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
59 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
29 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
15 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
2 3 4 5
38