Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
9 views

Getting a Sharepoint List Fields that are common to all content types contained in the list

I'm trying to get the list fields shared by all the content types in said List. After getting the List by its Title, I used the Fields property to get all the fields in the List: List list = ...
1
vote
1answer
23 views

CSOM: How to know if a Web has completed its creation?

I have a service that creates a Sharepoint Online site using CSOM. context.Web.Webs.Add(webCreationInformation); context.ExecuteQuery(); This site is created using a defined Template stored in the ...
0
votes
0answers
13 views

How to set NavigationNode AudienceIds

In a recent CSOM update by Microsoft (see here), the AudienceIds property of the NavigationNode has been made public I've been trying to set an Audience for the node using Powershell but so far no ...
0
votes
0answers
20 views

User cannot be found. error only on some folders inside a site

I am the admin of SP2016. I have created folders inside my site. When I access sharepoint via browser, I'm able to enumerate through all the flders/files. I'm trying to write a program via CSOM. Via ...
1
vote
1answer
22 views

CSOM: Intermittent Tenant Errors “Exception has been thrown by the target of an invocation.”

We have been seeing intermittent "Exception has been thrown by the target of an invocation." when querying the tenant this week. This occurs when either creating a new site, or trying to obtain site ...
-1
votes
0answers
17 views

Sample Code snippet to copy list items from source list to destination list

we need to copy list items from source list to destination list, The following things has to be considered Source List is having around 17000 items. CSOM C# Approach should be used. Throttling ...
0
votes
1answer
24 views

The property or field has not been initialized when setting a lookupfield id on another field

My snippet code below. What i'm trying to do first is be able to update batch items with large number of items(THIS WORKS) and in between be able to get a lookup id field from one of the fields and ...
0
votes
2answers
22 views

CSOM get subsites times out

I'm trying to fetch all subsites (just those at the root level, not sub-subsites, etc.). But, I suspect due to volume (4,000+ subsites), the following times out. clientContext.Load( clientContext....
0
votes
1answer
22 views

How to use windows credentials using CSOM

I need to use windows credentials instead of hard coded password because it's against our company policy to use hard coded username and password. I check some threads here and tried everything but my ...
0
votes
1answer
26 views

to connect to a site having form based authentication with powershell csom

i want to connect to a SharePoint 2013 site having form based authentication using powershell CSOM. With VS i can connect with X-FORMS_BASED_AUTH_ACCEPTED header. What alternative i have to use so ...
0
votes
1answer
23 views

Can I use elevated permissions using JSOM, CSOM, or REST?

I am working with an On-Premise SharePoint 2016 farm and I am looking for some way to elevate permissions, so I don't use the logged-in user's credentials but another set of permissions that the ...
0
votes
1answer
41 views

HasPublishedVersion property using CSOM C#

I am using SharePoint C# CSOM to get items from the SharePoint 2010 site Document Library. I need to check if the item has any published version. In SSOM we have to Property called ...
0
votes
0answers
15 views

Programatic access to sharepoint with CSOM with Full Control permission

I would want to create some automation on my site , currently my organization provides only full control access to the site.. is it possible to run CSOM C# code to create list items. since i am part ...
0
votes
0answers
15 views

How to check if a Wiki Page exists inside “Pages” library inside our remote event receiver

When working with server-side event receivers, I use the below code to check if a wiki page exists inside our "Pages" library or not, using GetFile() + SPFile.Exists:- DataTable currentTempletePages =...
0
votes
1answer
14 views

Updating a file without overriding the list item information

I am working on an app that when a file is created through Office, it asks the user to input the values for the fields that are stored in the Library's List. While that works great, I am completely ...
0
votes
1answer
19 views

Create a publishing wiki page inside our remote event receiver

Inside our sharepoint 2013 on-premises, i have the following code inside our server side item-added event receiver:- public override void ItemAdded(SPItemEventProperties properties) { base....
0
votes
0answers
19 views

Accessing the Secure Store Service using client-side code

Using JSOM or REST can I access the credentials in a Secure Store Service? I have a on-premise SharePoint 2016 Enterprise farm. And it will be accessed internally from a windows domain
0
votes
1answer
16 views

Changing a folder to a One Note Document in CSOM for SharePoint

I am trying to amend the Prog-ID on a Sharepoint folder so I can change it to a One note document. Here is my code in CSOM, but it just says Prog-ID is read only, but I have read this can be done, ...
0
votes
0answers
20 views

Create Folder and Share with Guest User without Microsoft Account in Sharepoint with CSOM

I am quite new in CSOM/Sharepoint development and have an interesting task to solve. Unfortunately I don't make as much progress with some details as I would like. A customer of mine wants a secure ...
0
votes
1answer
63 views

Update another field with an id of a lookup column

I have a list with around 1000 columns and I need to be a able to prepopulate another field with a lookupid of another lookup field on the same list I am getting error when I use: var ...
1
vote
1answer
18 views

Site collection administrator created through CSOM cannot view site

I am having a strange situation where I am not able to view a site collection as a site collection administrator. The catch is that I created the site collection admin through CSOM. Steps to ...
1
vote
1answer
71 views

400 bad request while connecting to sharepoint site using Azure Function app

I am new to azure function. i am creating a function to call a SharePoint site. But Stuck at execute query. Here is my code - var password = "Somepassword"; var username = "Some ...
1
vote
1answer
36 views

Should I use one or multiple ClientContext to update a very large List?

I need to update a large SharePoint List, about 10,000 items or more. Each ListItem has 4 columns to be updated. I don't know what the best approach for this scenario is: Use 1 ClientContext, fetch ...
0
votes
1answer
44 views

Authentication to SharePoint using secure authentication and CSOM in a .NET application

I'm using CSOM for making REST API calls to a SharePoint list from a C# application. This needs credentials (of course), however I've found that it needs a username and a password in plain text. ...
0
votes
0answers
39 views

The type of data at position 1206 is different than the one expected

I am using below code to access site/web but keep getting "The type of data at position 1206 is different than the one expected." error. We have two separate tenants and getting this error in one of ...
0
votes
1answer
40 views

Unable to load SharePoint online site object in recent CSOM versions

Having recently upgraded CSOM, loading the site object no longer works. This has been an issue on all versions since 16.1.8029.1200.. Anyone else come across this issue and found a way round it? We ...
1
vote
1answer
25 views

How to disable access request in SharePoint Online using CSOM

I am trying to disable access request using PowerShell CSOM. But when i try to set RequestAccessEmail to "", it does not work if the first radio button is checked. It will work only if the second ...
0
votes
2answers
31 views

Get users within o365 Group using CSOM

We have to fetch users who are site collection administrators of all the sites. For some site collections the users are displayed as o365 groups itself. How do we get users within the o365 group using ...
1
vote
1answer
33 views

Console application that runs periodically instead of remote event receiver

I have an enterprise wiki site collection inside our sharepoint on-premises 2013. and the enterprise wiki contain a server side remote event receiver which do the following:- when a list item is ...
0
votes
1answer
16 views

powershell update single line of text where lookup id is equal to value

I would like to update a single line of text field of my list where the lookup id matches the id of the lookup value in the other list. i did it like this but i cannot figure out the logic to make it ...
0
votes
1answer
17 views

How to set multi value metadata list field using jquery?

How to set multi value metadata list field using jquery? I am trying to update the vaule by passing term name and term ID. I am able to save single value but throwing error with multiple values: ...
0
votes
0answers
11 views

CSOM File Missing after upload to document library IF Check Out is Required

We have a strange scenario where we are uploading files to a SharePoint 2019 Document library. This is a standard Team Site document library, no custom content types or permissions (other than access ...
0
votes
0answers
16 views

Ensure User is failing to find users that are not in the site users list

I have been using EnsureUser to ensure a user has been added to the site users before granting them access programmatically. This has worked fine in the past but now I am trying to use the script on ...
0
votes
0answers
18 views

CSOM SharePoint authentication via cookies

currently i'm working on CSOM SPO, I have requirement not to store account password or app secret for NET Core application. Is there a way to authenticate by using Windows Authentication / ADFS? I ...
3
votes
1answer
25 views

Recycle Web, NOT permanently delete with PowerShell/CSOM

In SharePoint Online is there a way to send a Web (a sub site) to the site collection recycle bin via PowerShell/CSOM? I know that a web can be deleted with Web.DeleteObject() but this does a ...
1
vote
1answer
29 views

To check who is running scripts in On premise farm

Is there any way to get detailed report of who is running CSOM/JSOM scripts in SharePoint 2013 environment and what those scripts are doing?
0
votes
1answer
29 views

What permission does user need to load Sites and Sub-Sites?

using (ClientContext clientContext = new ClientContext("https://company.sharepoint.com/mysite")) { string password = pass; string userName = abc@contoso.com; ...
1
vote
1answer
41 views

PowerShell script to get site collection administrators, site owners in SharePoint 2013 CSOM

i want PowerShell script for SharePoint 2013 CSOM to get below details site collection administrators site owners Site is multilingual or not Please assist.
0
votes
0answers
15 views

Athenticate and Authroize External API

I am writting a .Net API, which will be consumed by a SPFx(Sharepoint Online) webpart. I need that API can authenticate and authorize via CSOM, because some of methods of these API need to be ...
0
votes
1answer
28 views

remove all users from a SPGroup on Save button click in NewForm.aspx using CSOM/REST

on save button click of my newsplist newform.aspx, i need to remove all the users from the custom spgroup. i tried with REST API, but there is no method to delete all users from the group! its allows ...
0
votes
0answers
14 views

Sending digest email every monday for tasks due in next 15 days

I am looking to automate an email alerting process for sharepoint online task list. I am working with SharePOint online and using OOTB task list not a custom list. Below is how my task list will be: ...
0
votes
0answers
9 views

How to use CSOM to access assigned tasks in the Workflow Tasks list without access permissions to the list

I need to programmatically approve or reject Workflow task in the Workflow Tasks list. The user has access permissions to the assigned task items but doesn't have access to the list itself. When ...
0
votes
0answers
17 views

Sharepoint 2013 CSOM get subfolder items only

I want to get particular folder or subfolders items only on demand, not all recursive. My code so far: private static void GetListItems(string relativeUrl) { var context = new ...
0
votes
1answer
36 views

Add owner to a newly provisioned ModernTeamSite using PowerShell

I have made powershell script to provision modern team and communication sites. I have a share point list where user selects relevant information for this site. The user also selects the owner and ...
0
votes
2answers
38 views

Get URL to site collection from site collection GUID

Using SharePoint Search Query Tool I have found out that some old "ghost" instances of my site collections exist on some servers in a big farm. When I use the search functionality in SharePoint I get ...
0
votes
0answers
21 views

2016 - SPField.FieldRenderingControl equivalent to CSOM or JSOM

Using the Microsoft.SharePoint, I can render SP Fields in custom application page using the below server side code. BaseFieldControl editControl = field.FieldRenderingControl; editControl.ID = field....
0
votes
1answer
25 views

Creating Sharerpoint online communication site with app-only authentication

I am trying to create a communication site using PnP CreateSiteAsync extension. When I authenticate using app-only credential the site is not created and I receive {"SiteId":"","SiteStatus":3,"SiteUrl"...
1
vote
1answer
15 views

Add a new button ribon with csom

I'm trying to add a new button in my sharepoint 2013 server via csom because in a few months I'll pass to project online and wsp aren't support anymore by project online So I found this guide on the ...
0
votes
1answer
30 views

How to fetch record id based on combination of 2 columns

I want to fetch a record id in a list based on combination of 2 columns not through REST API. I have a List A and a List B. We have fetched the employee name and project name from List A into List B....
0
votes
0answers
20 views

How to obtain permission levels granted through AD?

I would like to know if I can Obtain permission levels granted through AD of each user; I'm working with CSOM. So far I can validate if it exists in AD and if it is added in some group of AD, I can ...