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 [ssom]

SharePoint Server-Side Object Model

1
vote
0answers
12 views

SharePoint C# move attachment and keep creation values in SP 2019

We want to copy item attachments from one Item in one site collection to another item in a different site collection using C# (Server Side Object Model). Is it possible to keep or replicate the ...
0
votes
1answer
20 views

Access denied when trying to get SPListCollection out of SpWeb in BCS connector

I have a BCS connector. In a constructor of its service class I want to access a SharePoint list. using (var site = new SPSite("My site URL") { using (var web = site.RootWeb) { var ...
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
24 views

Not able to open document in Client Application in IE Edge Sharepoint 2016

we are using following code to CLose modal popup and navigate user to open Document in SharePoint 2016 OnPremise. Context.Response.Write(String.Format("<script type='text/javascript'>window....
2
votes
1answer
102 views

Web Application property bag : returned value is wrong - SharePoint 2016

We are currently encountering a strange problem with some values stored in the property bag of our Web Applications that we cannot explain. Basically, we have two Web Applications, one for the main "...
0
votes
2answers
779 views

Get items modified in last 24 hours from Site collection

I would like to have the report of items modified in last 24 hours from site collection Could anyone suggest me the best approach to hang with it either by going with SPaudit or with ...
-1
votes
2answers
476 views

How to refresh a sharepoint list from C# console application

Is there any way to refresh a SharePoint list from C# console application. NOTE: By refresh I mean the same that we achieve by doing a Ctrl + F5.
0
votes
1answer
802 views

How to clear browser cache or cookies when user logout?

I have custom signout.aspx page which is auto redirected when user session timeout expired. Problem is when user clicks the Back arrow or opens same site again, there is no prompt for authentication ...
0
votes
1answer
869 views

How to get the homepage / welcome page of a web with site.WebTemplate PROJECTSITE

to check if a user account has access to the homepage of a site collection, I have to get the root web's homepage. In most cases it works by using using (SPWeb web = site.RootWeb) { String ...
0
votes
2answers
835 views

How to loop through all subsites under a subsite using SharePoint server object model

I want to write the following inside a c# console application:- I have a site collection http://servername/ This site collection have a subsite http://servername/customers/ And inside the customers ...
0
votes
2answers
1k views

Get value of PeopleEditor control field in a string

How can I retrieve value of SharePoint:PeopleEditor control in a string programmatically in Server Side Object Model (C#)?
0
votes
1answer
63 views

SPWeb object properties turn to “null reference exception”

I am currently working a Farm Solution that is supposed to work with SharePoint 2016 and I am facing something that I can't understand. Maybe someone could explain this phenomenon or point what I am ...
0
votes
1answer
75 views

Cannot update user profile custom property through ssom

I m trying to update the user profile "State" custom property using below code but getting following error. We have even tried to restart the user profile service but it couldn't fix the issue. Any ...
1
vote
0answers
22 views

Saving files in physical location in all WFEs of the farm

I have a farm with 3 servers, 2 WFEs and one out of rotation for crawling. I need to save files in physical location in 2 WFEs through SSOM code. How can i do it? Thanks Diwakar
0
votes
2answers
481 views

SPList workflowassociations is empty

I have a documents list on sharepoint 2013 associated with a simpel sharepoint designer workflow. I am able to start the workflow on the list items from a timerjob using csom code. But when trying to ...
6
votes
2answers
137 views

SPContentTypeId.Empty vs default

Is there any reason to prefer SPContentTypeId.Empty over default? Console.WriteLine(default (SPContentTypeId)); // writes 0x Console.WriteLine(new SPContentTypeId()); // writes 0x Console.WriteLine(...
0
votes
3answers
71 views

Check SharePoint lists are identical

Is it possible to check two SharePoint lists are identical in terms of list columns(Column names and types) programmatically?
0
votes
1answer
50 views

getting all AD groups and users of a site collection

Hello everybody I am quite new to the Sharepoint, I am trying to get all the AD groups who have permissions on a sitecollection. I am able to get all the SPgroups and users using the code below in my ...
1
vote
1answer
52 views

DocumentSet.Import returns [Exception : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))]

I'm getting the [Exception: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))] when trying to import documentSet programmatically from a site collection document library to ...
0
votes
1answer
129 views

Update the selected view in list view webpart using C#

Please help me to reflect the view changes to the web part pages programmatically using C# Is it possible ?
0
votes
1answer
35 views

Issue with Date difference in Event receiver, If updates is coming from JSOM and SSOM

We are adding item in list with Jsom and SSOM. Following is the scenario when item is added through SSOM , we have a date field in which date is proper. Once item is added , we have an event receiver ...
0
votes
1answer
22 views

Set UniqueId of SPListItem

How to set UniqueId property of SPListItem programmatically using SSOM?
-1
votes
1answer
80 views

Check if specified user belongs to specific group or not

I have implemented a site and have added a SharePoint group called "SG_Uploader". In this group, I ONLY have one Active Directory group called "AD_L6" and there are many users in AD_L6. If a user ...
0
votes
1answer
80 views

Sometimes the template returns null

Add-PSSnapin Microsoft.SharePoint.PowerShell $web = Get-SPWeb "http://SPWeb/sites/MyApps/Orders" $template = $web.GetAvailableWebTemplates(1033) | Where-Object {$_.Title -eq "Order_Template"} $newweb =...
1
vote
2answers
1k views

BreakRoleInheritance(true) has no effect on Document Set Sub Folders

I am trying to Break Inheritance on a sub folder within a Document Set using the following code. After running the code and examining the Document Set's Sub Folder I can see that it still inherits ...
0
votes
1answer
158 views

Filter SharePoint 2010 list web part

I have a Custom list view web part on a SharePoint Page. The List has a custom date field "Exam Date". I need to filter the list items based on current month, week and day. I don't want to use the ...
0
votes
2answers
56 views

How to: Add dynamic server-side generated values to a masterpage

SP 2013 On premise. Publishing enabled. We use AD Groups to organize our users. These AD groups are then added to 1 or more SP groups for the purpose of audience targeting. I now have the need to hide ...
1
vote
1answer
210 views

Check if CurrentUser is in AD group inside SharePoint Group

Here's the scenario: All users belong to an AD Group. We add that AD group to a SharePoint group. I need to determine if the user is in that SharePoint group using JavaScript. If this is not possible ...
0
votes
1answer
66 views

What is the best Object type i can use that represent a site column of type People or Group, which can hold SPUser or SPGroup

I am working on an Event Receiver for my SharePoint farm 2013. now i have a site column of type "People or Group", and this site column can hold User Name/s OR group names. so inside my Event ...
20
votes
2answers
412 views

ProjectPolicy.SavePolicy() : server side giving error : The collection cannot be modified

Trying to modify ProjectPolicy Properties server side is giving me an error : List<ProjectPolicy> availPolicies = ProjectPolicy.GetProjectPolicies(web); ProjectPolicy policy = availPolicies....
5
votes
1answer
447 views

How to resolve “Your search cannot be completed because no Search service is available. Contact your administrator for more information.”?

I am working with SP2016 Farm solution. I have configured a Search Service on my farm, customized the result source too. When I use the result source in Content Search WebPart on SharePoint Page, it ...
1
vote
3answers
383 views

How to get the site lastvisted time of the user in SharePoint 2013?

I need to get the site last visited time of the user's, and need to update that time in userprofile properties. I am not sure any api or in build functionality available. Pls suggest me some idea to ...
1
vote
1answer
40 views

Show Button only to Site Administrator

I have a asp.net button , And I would like to show only to sharepoint site administrator using Server Object Model. Can any one help me how can I do this.
3
votes
1answer
159 views

Server Object Model to recursively loop through All Sites Collections and there sub-sites of Web-application

This is my First Post on SharePoint and I am new to SharePoint.I am listening lot of positive buzz on sharepoint.stackexchange , And i hope I too get the same support from you all folks. My ...
1
vote
1answer
26 views

Unable to access Site Users and Groups using SPSecurity.RunWithElevatedPrivileges

I am unable to access the sharepoint users and groups using below code to access all the users and groups of site collections of web application including their sub-sites and child sub-sites Can any ...
1
vote
1answer
81 views

Use PowerShell on a large site to do a permissions find and replace

I've inherited a site collection that has 20,000+ subsites. I cannot connect any management tools to it like Metalogix or ShareGate and I've been told PowerShell will fix it. I hope to batch the jobs ...
0
votes
1answer
188 views

Cannot change permissions of root web : On Using web.BreakRoleInheritance(true, false);

I am new to SharePoint programming and had written the below code to access all groups and group users from a site collection including all subsites using web.BreakRoleInheritance(true, false); . So ...
3
votes
2answers
384 views

Server Object Model to get Users & Group details of Site Collection and it's site levels

I am new to programming , And seeking desperate help from you folks . Need to get all the users of Site Collection ,Even on breaking in-heritance between sites and sub-sites. Can any one help me how ...
0
votes
2answers
296 views

SOM to loop in all the Sites of Site Collection

I am new to sharepoint programming I have requirement to loop all the sites of site collection which should also loop including sub-sites. Can any one help me how can I do this via Server Object ...
1
vote
0answers
196 views

Export the user list and there corresponding permissions for the entire site collection

I am looking to export the users and there permission level at site collection level. Could any one please help me how can I do this with powershell script
1
vote
0answers
73 views

Rename Document in ItemAdded

im trying to rename a document in the ItemAdded event receiver with the following code: public override void ItemAdded(SPItemEventProperties properties) { properties.ListItem[...
1
vote
0answers
22 views

Nintex Browser Control Shortened in sharepoint [closed]

My Nintex form is working fine for list and document libraries ,But when my users try to browse the attachment "Browser" option is getting Truncated as below. Can any one help me what's the issue ...
0
votes
0answers
28 views

WebPart Properties Missing in WebPage

I have the issue where I am unable to edit the web-part in sharepoint page,Similar to this blog-post.And I found the solution by following below steps . Solution: Open Internet Explorer, select the ...
1
vote
2answers
200 views

Can't access user profile in event receiver

I am trying to access a user profile property in a list item event event receiver(item adding). But I get the following error The user could not be found in the database. You must first create ...
2
votes
1answer
691 views

Copy document library from one sitecollection to another using powershell

copy the document library with metadata from one to another site collection using PowerShell
0
votes
1answer
30 views

Unable to get the CrossListQueryCache in Foreach to loop the list item

I had used CrossListQueryInfo to get the large amount of items from lists. When I am trying to use the object of CrossListQueryCache I am facing below error. Can anyone help me what's the issue and ...
0
votes
0answers
64 views

Keyword Query Language to get all the Items holding particular SharePoint Security group from Site Collection

I have requirement to get all the items from Lists & Document Libraries of entire site collections holding SharePoint Security group name "Inspection" using Keyword Query Language. Can any one ...
1
vote
0answers
71 views

Can I turn off validation for URL field

Maybe it is a strange question, but is it possible to prevent the validation of a URL entered in a URL field? The link in the URL field points to a Sharepoint site in the same site collection, but ...
2
votes
0answers
162 views

Any SharePoint tools to convert Server Object Model Code to Powershell

Is there any tool to convert the SharePoint server object model to PowerShell?