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
2answers
22 views

get audit log value CSOM

I have problem how to create API get Audit log and get return value via CSOM? when i try to this Site collection audit settings for Sp online using CSOM this is i can't get value it's only save to ...
0
votes
1answer
20 views

Getting to count of documents where modified older than 30 days

Is there anyway to get the count of documents where document has not been modified for 30 days? I was thinking of CAML query but is it possible to only get the count? Some list contains hundred of ...
1
vote
1answer
21 views

ReadOnlyField Vs ReadOnlyEnforced when creating Site Columns

When creating a new site column inside Sharepoint Online, we have 2 options to set: ReadOnlyField and ReadOnlyEnforced. So, what are the differences between these 2 settings? As far as, I know ...
0
votes
1answer
24 views

SharePoint CSOM with .net standard | Credentials vs App

I am trying to understand how the authentication works using a .NET core application to O365. The article here describes it: https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/using-csom-for-...
0
votes
1answer
37 views

CSOM code is raising this error “Version conflict.” when trying to update ListItems inside foreach

I have the following CSOM code:- using (ClientContext context2 = Helpers.GetAppOnlyContext(properties.ItemEventProperties.WebUrl)) { try { ...
0
votes
1answer
31 views

I am able to update a ReadOnly field inside my CSOM code

I have set a field as read-only using this PnP script, the field is of type "image or hyperlink":- $fieldTitle = "LinkToRiskValue" $customfield = $Context.Site.RootWeb.Fields....
0
votes
1answer
45 views

copy or move replace file and update version sharepoint CSOM

hi im using method for copy or move file on sharepoint. but i want to ask how to implement when it's duplicated it automatically replace and update version? i've been try with this function but it's ...
0
votes
0answers
11 views

Getting users and groups from root of permissions with CSOM

We can easily get all the SharePoint groups and iterate users and groups within those. var groups = SPOContext.Web.SiteGroups; SPOContext.Load(groups); SPOContext.ExecuteQueryWithIncrementalRetry(3, ...
0
votes
1answer
37 views

Error Method “OpenBinaryStream” does not exist SharePoint file download using CSOM C#

we are using the below code to download a file from the SharePoint 2010 on-premise and from SharePoint online site. The code is working fine SharePoint online file and getting the error Method "...
0
votes
2answers
35 views

Unable to get the list default edit form URL using CSOM Powershell

I am using the CSOM for PowerShell to get all the default forms(new/display/edit) used by the list in SharePoint online site. Below is the code snippet for the same. $NewFormUrl = $List....
0
votes
1answer
27 views

How can I export a sharepoint online list with version history enabled to excel?

I have enabled version history on my custom list. Now when i do an export to excel all the multiple text fields don't show any data at all. How can i get it to export all the fields with data and the ...
0
votes
1answer
21 views

Is it possible to add different person-value items to SharePoint list using CSOM? C#

I don't think it is possible, but hoping I am wrong. I'm using a CSOM in a C# application to update a SharePoint list (SharePoint Foundation server). All of the items on the list are updated correctly,...
0
votes
2answers
19 views

Unable to update a field internal name. Erro “Property or indexer 'Field.InternalName' cannot be assigned to — it is read only”

I have the following CSOM code to update a field internal name:- using (ClientContext context = new ClientContext("https://*****.sharepoint.com/sites/Intranet/")) { ...
0
votes
1answer
29 views

'ListItem' does not contain a definition for 'SystemUpdate' and no accessible extension method 'SystemUpdate'

I have the following CSOM code inside a console application:- ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation(); ListItem listItem2 = riskValue.AddItem(itemCreateInfo); ...
0
votes
0answers
15 views

How to download the root-folder SharePoint aspx file including web-parts using PowerShell csom?

I want to download the SharePoint 2013 root folder aspx files to local path and then copied to SharePoint 2016 sitepages library. Tried below code but it downloading empty aspx file without webparts....
0
votes
0answers
18 views

Create a SharePoint sharelink with expiration and password using C# CSOM API

From the SharePoint UI, you can share a document by providing an expiration date for the link and also securing that link using set password. Can the same be achieved from C# code using CSOM libraries?...
0
votes
1answer
13 views

Cannot set properties of default fields on SP.Folder item with JS

I'm working on code to create and set properties of folders in SP 2013 with JSOM. My current setup involves the following: var ctx = new SP.ClientContext.get_current(); var list = ctx.get_web()....
0
votes
0answers
15 views

Getting thumbnail data for documents with CSOM / API

In our project we're trying to integrate with SharePoint Online using SharePoint App-Only authentication method and client-side object model (CSOM) to retrieve data. This solution seems to be working ...
1
vote
0answers
16 views

Unable to connect remote server error appears randomly after CSOM request

I'm currently working on a C# CSOM script for a SharePoint Online Instance that will return to me all the items in a particular list that have no attachments. Everything seems to be working well but ...
1
vote
0answers
23 views

Get Terms Path as per locale in SharePoint Online using CSOM

I am struggling to get terms path as per current locale. I have proper settings in SharePoint Term store for getting term label in English, Italian and German languages. I am getting taxonomy labels ...
0
votes
2answers
45 views

SharePoint Online deduplicate large list

I am struggling to find a solution to my case where I have like 300k items in a SharePoint Online list, by accident. I have generated a file using PowerShell that contains all duplicated items. I was ...
0
votes
1answer
38 views

Attach a file to a list item using CSOM will raise the following error “The file format or file extension is not valid”

I have the following code to attach a file to a list item:- context.Load(context.Site); context.ExecuteQuery(); Microsoft.SharePoint.Client.File fs = context.Site.RootWeb....
0
votes
0answers
17 views

How can i get Term hierarchy Translated as per user locale in SharePoint Online

I have a scenario where i get all terms from SharePoint term store using CSOM and then I return result with term full hierarchy, because my site supports multiple languages so i need to see this data ...
0
votes
0answers
16 views

Could not load file or assembly 'Microsoft.SharePoint.Client.ServerRuntime' if Owin Automatic App Startup is true in Web API

I'm trying to implement Web API authentication using Microsoft.Owin. This Web API contains SharePoint 2019 CSOM libraries (Microsoft.SharePoint.dll & Microsoft.SharePoint.Client.Runtime.dll) that ...
0
votes
0answers
31 views

What is SharingLinkKind.Flexible? and how to use it?

I have an app that should be able to create all the different types of SharePoint ShareLinks. There is a "Flexible" value in SharingLinkKind enum but it has neither a documentation nor a ...
0
votes
1answer
11 views

Creating Library from custom template

I have written some code which saves a Doc Lib as a template. I am wanting to create an identical copy of how the Doc Lib is set up content types, views etc but none of the files inside the library. ...
0
votes
1answer
22 views

Helper Methods: Passing ClientContext vs using list.Context

I am creating some helper methods for a SharePoint Online CSOM development project. Are there any issues with using the Context from the List object or should I explicitly pass the ClientContext to ...
0
votes
1answer
25 views

Set Target Audience to the list using Power Shell Script

I’ve a list called “ABC” in root SharePoint online site collection and it have no. of columns. One of the column, say “xxx” is type of “Hyperlink” field which contains the Sub Site URL with display ...
0
votes
1answer
28 views

Sharepoint online powershell usercustomactions scriptblock not working

I want to add a warning message at the top of the SP online site. For that i tried UserCustomActions using powershell, code is running without error but not working. I tried to add ribbon control that ...
0
votes
1answer
42 views

How to update one drive file using SharePoint CSOM C# code programmatically?

I am looking for a way to update the one drive file or document using some SharePoint CSOM code. So can we achieve this using CSOM or some C# code? I have even tried to load one drive site collection ...
0
votes
2answers
46 views

Check who has given permission to a user in sharepoint online

In sharepoint line for a site I have a few site owners. One owner has stopped inheriting permissions for a library and a folder and gave access to a user. As a tenant admin I want to know who that ...
0
votes
0answers
13 views

CSOM - overwrite content of file in document library without increasing version

How to overwrite content of file in document library without increasing version? We are using api where SystemUpdate is not available yet.
0
votes
0answers
19 views

Fine grained permissions applied to SharePoint Online App-Auth?

We have written an application that access SharePoint CSOM apis to do the following: Get sharepoint users and groups in a site collection. Get sites in a site colleciton Get lists in a site ...
0
votes
1answer
22 views

Can a user who is not a SharePoint Online administrator create a site collection with a template other than communication site or team site?

I have a user who I do not want to promote to a SharePoint Administrator, but I do want to allow them (because they are a developer) to create site collections with the template DEV#0 without having ...
0
votes
2answers
31 views

How To Retrieve all the List URL In SharePoint 2013

I want to get all the list URL from SharePoint 2013 using PowerShell CSOM. Some one could suggest on this?
1
vote
1answer
25 views

Powershell CSOM with PnP AuthenticationManager: flush credentials

I've been using an OfficeDevPnp.Core.AuthenticationManager for a long time, in order to support MFA for PowerShell scripts targeting SharePoint Online with CSOM. For my current task, DEV is on tenant-...
0
votes
1answer
24 views

How to Cancel item level InProgress Workflow in SharePoint 2016 using CSOM

I want to cancel the In progress item level workflows in sharepoint 2016 using client side code in Powershell Or C# console app. Searched most of the links , But nothing is working. programmatically-...
0
votes
0answers
18 views

SharePoint On Prem High Trust 401 fun

This has been done to death but I have gone past madness. I just want to execute CSOM as the logged on user. using (ClientContext clientContext = new ClientContext(SharepointURL)) { clientContext....
1
vote
0answers
22 views

Access Denied error while getting checked out file without any version for read only site in SharePoint online environment

I am using the following CSOM code to get the checked out files without any version using (context) { List list = context.Web.Lists.GetById(new Guid("List id as string&...
0
votes
2answers
72 views

How to set Sharepoint Onprem site collection to Readonly with powersehll csom?

I want to make SharePoint on-premise and SharePoint online site collection to Readonly. For SharePoint online i can able to achieve with Pnp commands.But on-premise is not working. code i have used ...
0
votes
0answers
15 views

Error: The SPListItem being updated was not retrieved with all taxonomy fields after creating Managed Metadata field programmatically

I have searched before asking this question. Also, I have done as suggested by this answer https://sharepoint.stackexchange.com/a/83794/81955 but my problem still persists. My scenario: I have 2 hub ...
0
votes
0answers
113 views

Creating new project with mandatory custom lookup fields via CSOM

I have to create new project with required custom lookup fields via CSOM and I have got the CustomFieldRequiredValueNotProvided exception. Here is my code. What am I doing wrong? using (...
0
votes
1answer
43 views

Site sharing settings via CSOM

Can these settings be accesed via CSOM?
0
votes
0answers
23 views

Alternate method for GetWebPartPage method in SharePoint Online CSOM

I have a code which uses GetWebPartPage method from "/_vti_bin/webpartpages.asmx" SOAP service. This method returns WebPart Page content including webpart zone data. I am trying to get ...
0
votes
1answer
82 views

System.Net.WebException: The remote server returned an error: (429)

I'm executing a CSOM Powershell script on my SPO Tenant. This script exports all list items and documents which has unique permissions. The script is working fine however I get the below errors ...
0
votes
2answers
67 views

How to apply site-design in SharePoint Online?

Does any one know how to apply the custom site design to the team site collection URL in SharePoint online through client side object model?
0
votes
0answers
20 views

How to Compare SharePoint Groups and Users Permissions are same in both target and Source site?

I want to compare the Groups and users from source(SharePoint server 2013) and target site(SharePoint online) using powershell script. I have tried below code but i am not able to retrieve "...
1
vote
0answers
26 views

Editor and Author not changing to custom user value

CSOM when trying to copy the editor and author who created a list item in a different list while copying items between lists. The Author and Editor are showing as my name instead of the copied user id....
0
votes
1answer
42 views

Accessing list from Subsite from SharePoint online using c# CSOM

I am using simple console application to pull data from a SharePoint Online list using the following code string siteUrl = "https://MyServer.sharepoint.com/sites/MySiteCollection"; string ...
3
votes
0answers
97 views

Difference between camlQuery.AllowIncrementalResults=true and camlQuery.AllowIncrementalResults=false?

My aim is to get all items from a SharePoint List (>5000 items). I have used the standard pagination based approach and it is working fine. ListItemCollectionPosition position=null; do{ ...

1
2 3 4 5
36