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.

1
vote
2answers
22 views

Returns all values from all columns in a list (CSOM)

I'm stuck to something probably very basics So the idea is the following: I have a list with 4 columns : Title, CostCenter, City, currency Via CSOM, I'd like to read this list, so I did something ...
0
votes
1answer
29 views

Wildcard Query for SharePoint Rest API

I tried using this example as search parameter "Share*" but the result return nothing. Interestingly,if i try searching for the word "share" i do get the result containing the SharePoint word. That ...
0
votes
1answer
45 views
+50

CSOM Powershell eating up memory

What is the proper way to free up memory in Powershell when looping trough list items? This loop is slowly eating up the memory: for ($ID= 94368; $ID -le 98970 ; $ID++) # foreach ($ID in $Ids) { try ...
0
votes
0answers
24 views

Reading doc files from SharePoint returns null

My scenario: i am trying to read doc file from SharePoint 2019 server.My application is running on a separate IIS server. For docx file my code works well(not shown here) but not for doc. Error :...
0
votes
0answers
9 views

file.OpenBinaryStream cannot open file greater than 5 MB

I am reading file from SharePoint 2019 on premise and files that are greater than MB crashes the code. Error stating that Files greater than MB cannot be opened. I am creating an ASP.NET app using ...
0
votes
1answer
29 views

The remote server returned an error (401) unauthorized

I have install a fresh version of SharePoint 2019 which is on domain A,then i added a second computer to A which will be hosting websites on IIS. I have created a console application just for testing ...
1
vote
1answer
35 views

Unable to read doc extension file from SharePoint 2019

I am using the code below to read files from SharePoint 2019 server. It works perfectly for docx file extension but with doc files it throw an error. Can you guy s help me out here please? using (...
1
vote
1answer
15 views

Fuzzy Search in File content

My scenario : I am testing the search engine in SharePoint 2019 server. What i found out is that fuzzy search works in this way WORD then after i can place an asterisk(WORD*). What i am trying to ...
0
votes
1answer
16 views

Get Workflow Status Programmatically in SharePoint Using Client Side Object Model JavaScript

I am trying to monitor the status of workflows using JavaScript in the SharePoint Farm. List A: Number of Completed: In Progress: Error occurred: List B: ...
0
votes
0answers
29 views

Using SharePoint search API to crawl document with c#

My scenario : I have a SharePoint 2019 server that contain some documents with different file extension (ppt,doc,docx,xls,xlsx,pdf etc). I have manually forced indexing and crawling to make sure my ...
0
votes
0answers
20 views

Disable welcome email for 365 groups/modern team sites

Is there any similar for c# for those PowerShell command? Set-UnifiedGroup -Identity "DynO365" -UnifiedGroupWelcomeMessageEnable:$false I need to disable the welcome email when adding users from ...
0
votes
1answer
27 views

Bulk item Insert/update in SharePoint list using JavaScript

I want to add items in bulk (around 13000 entries) into the SharePoint list using the JavaScript. For this I have already user CSOM Client Context Batch insert code and also I tried the SP.Services() ...
0
votes
1answer
33 views

CSOM CAML query with ID row limit 1 returning list threshold error

I'm using the following CAML query in my CSOM code to try to determine the highest list ID in a list. I'm getting the standard list threshold limit error (because the list contains over 23000 items). ...
0
votes
2answers
29 views

How to authenticate to use SharePoint rest api

I am using the code below and am getting unauthorized access. Can you guys show me what i am missing here.I am using SharePoint 2019. string URL = "http://sharepoint/sites/test/_api/search/query?...
0
votes
2answers
24 views

CSOM Copy List Items

I was create Ribbon Custom Action, and try to copy list items selected to same list, but F12 error? what is the problem? function runCode() { var targetListItem; var values = SP.ListOperation....
0
votes
0answers
84 views

csom sharpoint online

I have requirement where i need to create escalation matrix , i had four columns in sharepoint like below Column1|Column2|PersonGroup1|PersonGroup2 I had to send email to PersonGroup1 user all items ...
0
votes
0answers
8 views

Setting list item permission using WCF services and Consuming it

I have been using SharePoint Workflows to automate approval processes. Occasionally, we get some of workflows failed for no obvious reason. After re-starting them, it works fine. To avoid these type ...
0
votes
0answers
10 views

How to view all SharePoint 2013 Workflows in a custom web page using CSOM?

I would like to monitor all of workflows in my site collection using CSOM. What is the best approach to achieve it?
0
votes
0answers
10 views

Using CSOM to determine if a publishing page has a currently published version even if the current version is checked out?

I'm working with SharePoint 2013 C# Client code (CSOM) and I am trying to determine if a page with lets say 20 versions has any version that is currently published even if the current version is "...
0
votes
1answer
29 views

check folder has unique permissions

I have a Folder structure like Below RootFolder-->Folder1,Folder2-->FF2 I want to check if RootFolder has Inheritance broken like below. It is not working what i am doing wrong Add-Type -Path "C:\...
0
votes
0answers
8 views

Which email property in SharePoint 2019 will be used to send an email to an user?

The SPUser object contains the property "Email". The UserProfile contains the property "WorkEmail". Which of these properties will be used by SharePoint to send an email for example from a workflow to ...
0
votes
1answer
28 views

copied folder break inheritance fails

When i copy the folder with in same document library and trying to break inheritance it fails. below is the code for the same. Can any one help on the same Add-Type -Path "C:\Program Files\Common ...
0
votes
0answers
16 views

Unable to correctly set access request settings

I have this CSOM in my PowerShell script: $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($url) $SPOCredentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($...
0
votes
1answer
13 views

CSOM: Unable to update or create content type - Value cannot be null. Parameter name: s

When creating or updating content types using PnP/CSOM we are encountering the following error upon executing the query: Microsoft.SharePoint.Client.ServerException: Value cannot be null. ...
1
vote
1answer
21 views

Sharepoint client object model “File not found” Powershell

I have some issue when i try to create a folder, but the same issue come out when i try create file too. this is a sample of my code : $web_sp = $session_sp.Web $session_sp.Load($web_sp) $session_sp....
0
votes
1answer
13 views

how to know sharepoint server is foundation or standard using csom?

I want to know how to find out the SharePoint server is enterprise, foundation or standard using c#.
0
votes
0answers
35 views

SP2013: SPSecurityContext: Could not retrieve a valid windows identity for username 'DOMAIN\USER' with UPN 'user@domain.com'

I have the following CSOM code using (var clientContext = new ClientContext(new Uri("http://localhost"))) { try { var siteCol = clientContext....
0
votes
0answers
19 views

C# CSOM Create Folder and update SharePoint List (On Premise 2019)

I have a task where I need to perform the following tasks; Create a folder in SharePoint Titled on a company name Update a list item URL field with the URL of the folder from step 1, where the ...
0
votes
1answer
17 views

Retrieve content type id from content type name using CSOM

I have site content type available in my SP 2013 site, I need Content Type ID by content type name using CSOM. I found the way by using rest api from here Get Site Content Type ID by Content Type ...
0
votes
0answers
7 views

Get user permissions for a specific project by Guid in Project Server

Is there a way to get user permission for a project using its Guid. I have seen that you can get the permission of a user for the site but I am only interested in the users permissions for a specific ...
1
vote
0answers
19 views

CSOM access to Virus Scanning Status

I am connecting to a SharePoint Online tenancy and interrogating a document library using CSOM. Is it possible to determine in code whether or not the anti-malware scan (which I know runs ...
0
votes
0answers
36 views

SharePoint 2013 - Custom mention people with SSOM

We are developing a new blog post implementation and it will work like as microfeed. On the other hand we just wanted to implement mentioning feature and we wanted to implement it at the backend side. ...
0
votes
0answers
22 views

Can not update user profile property using CSOM for SharePoint onprem

I am trying to update user profile property using CSOM for SharePoint onpremise, but the value was not updated to the property. There is no error exception. I try with JSOM but it does not work also. ...
0
votes
1answer
72 views

Create Site Collection using CSOM for SharePoint 2019 On-Premise

We are trying to get Site Collections to be created from CSOM (C#) and are having trouble. Almost all examples of this found on the Internet are for 2013/2016 SharePoint or SharePoint Online. In ...
0
votes
0answers
14 views

CSOM or Microsoft Graph check if list/library can be deleted

Is it possible to check if a list/library can be deleted? Is there a property that is used in the UI for this? In SharePoint Online custom lists/document libraries can be deleted The default ...
1
vote
1answer
30 views

List Folders in Document Library using CSOM

I want a list of folders in a document library avoiding any subfolders or files in it, using CSOM in Sharepoint Online. Could some one share the code for the same.
0
votes
0answers
14 views

SharePoint Online edit list view web part toolbar programmatically

Hi I inherited this site in classic experience and a Page Layout with 42 instances and with 28 list view web parts on each page instance. I need to update all web parts on all pages so that the ...
0
votes
0answers
22 views

Set file metadata directly on upload for records library with CSOM

I have the following issue: I want to upload a file to a library (with CSOM C#) that automatically declares all new files/items as records. The site collection setting for records is set to prevent ...
0
votes
1answer
39 views

OfficeDevPnP.Core used in azure function (v1), alternatives

it looks like not possible to prepare an Azure function dealing with the newer small features like dealing with client side pages (e.g. headers part) and any newer as up coming "Page Site Templates": ...
0
votes
1answer
36 views

Not understanding why one CAML query is throttled, but not another

I am not understanding why this CAML query from CSOM is getting throttled: <Query> <Where> <And> <Eq> <FieldRef Name="Period" /> <Value ...
0
votes
0answers
16 views

How can I collect all changes from a web site and its descendants

Is it possible to use Web.GetChanges to collect all changes that has happened to objects stored on a web site and its sub sites? Using the following query and change token only returns changes on the ...
0
votes
0answers
9 views

Save site as template in sharepoint online using CSOM Approach

can anybody help us how to save site as template in sharepoint online using Client Object Model approach (CSOM C#)? any help would be appreciated
0
votes
1answer
14 views

How to store user search queries in SharePoint Online in a list

I want to store the user search queries which are entered in the search box in a list and display them in a page without duplicates. I know I can get the excel report from popularity and search ...
0
votes
0answers
27 views

unable to connect with SharePoint site using CSOM

I am trying to connect to SharePoint 2013 site with CSOM using a function with 2 arguments. When i am giving only $x that is site URL as argument then code is working fine but when i am giving two ...
1
vote
0answers
30 views

Provider hosted app: TokenHelper not authorized to get context

I followed this tutorial to deploy Provider Hosted App to production environment. It has a proper SSL certificate installed, it's registered within SharePoint and TokenHelper class is modified. App ...
1
vote
0answers
20 views

Why is there a UUID attached to each object identity?

I am using CSOM to access sharepoint objects, and I need unique identifiers for site collections, webs, lists, and list items. So when you have an object identify for example for a site collection, ...
0
votes
0answers
9 views

Adding a AD group to a SharePoint group on multiple sites using csom

Im currently working on a script that will add a AD group to multiple sites via csom powershell where the sites are loaded from a CSV file. After what i have found online, im trying to use the Add-...
0
votes
0answers
19 views

Restore List item to the older version using CSOM C# approach

we need to restore list items from a particular list (not document library) to the older version but what i can understand is for document libraries we do have that provision like Item.File.Versions....
0
votes
0answers
14 views

While Executing this code am facing the following error as Error :Index and length must refer to a location within the string. Parameter name: length

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.SharePoint; using Microsoft.SharePoint.Client; using System....
0
votes
2answers
57 views

Fetch all site collections using CSOM

We are trying to fetch all site collections in our SP Online tenant using the below code. SPOSitePropertiesEnumerable prop = null; prop = tenant.GetSitePropertiesFromSharePoint("0", true); ...