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

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....
0
votes
2answers
778 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 ...
0
votes
2answers
432 views

Programmatically Create Site Collection within a Specific Content DB or move to a specific Content DB using SP Object Model & Not PowerShell

Is it possible to specify the Content DB to which a site collection will belong while creating a Site Collection? I am using the SelfServiceCreateSite API. If not, is there a way to move a site ...
0
votes
2answers
303 views

Adding SPNavigationNode Shows Incorrect Title

When adding a navigation node as like so: foreach (SPNavigationNode node in web.Navigation.QuickLaunch) { if (node.Title == "Parent Title") { SPNavigationNode newNode = new ...
-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.
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 ...
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
146 views

ICustomRouter interface >> CSOM or Server Side Object model

We are looking into a custom document route, and I know about the ICustomRouter interface. Can it be used in CSOM? The ICustomeRouter example here: http://msdn.microsoft.com/en-us/library/microsoft....
1
vote
1answer
1k views

Prevent folder deletion in document library - Explorer view snafu

We want to prevent users from deleting top level folders in a document library. We created an event receiver on ItemDeleting that checks if the item type is a folder and if the path is the top level, ...
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
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
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 ...
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
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 =...
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
1answer
86 views

Audit users accessing site

I know analytic reports for visits and hits for a site, it doesn't show who all accessed and time. I want to audit users accessing site. Is there any way to do it using Server Object Model or other? ...
0
votes
1answer
21 views

SP07 - Get items from choice textbox and insert into DropDownList (-programmatically-)

I have a list (WayBill) with column(ProdyctType). I need to get these items and input then into dropDownList. This is my columnType in SP07: This is my code: protected override void ...
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
90 views

Failure to turn on list auditing programatically

I have a SPListEventReceiver with a ListAdded() override that responds to the creation of Document Libraries. What I am trying to do is turn on auditing for the newly created Document Library like so: ...
0
votes
1answer
247 views

Allow Posts and Discussions to use same Categories lookup field

I am creating a Community site and activating the BlogContent feature on that site. There are conflicting issues, because the Community Site and the BlogContent feature both create a Lookup List ...
0
votes
1answer
247 views

SSOM Embed Code when inserting list item

Clicking this button in the list's ribbon, I can properly embed HTML so SharePoint doesn't strip anything out. I have some HTML that I need to insert into a list item field via C# code. How do I ...
0
votes
1answer
867 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
1answer
104 views

Looping through active directory nested security groups in SharePoint

Is there a way to loop through the nested security groups in active directory, with or without using LDAP in SharePoint?? I have tried SPUtility.GetPrincipalsInGroup but Im not geting nested groups ...
-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 ...
3
votes
0answers
99 views

What does it mean when a message for a thrown exception is a GUID

I noticed this unexpected entry in the trace log on one of our on-premise 2013 farms: 85c6b8ca-b2a3-4c6e-8a9f-d60d96224577 Stack trace: at Microsoft.SharePoint.SPFile.GetFileStream(...
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?
2
votes
0answers
210 views

How to get the SharePoint Group Name based on PrincipalID

I am trying to get the name of SharePoint group based on PrincipalID, But finding no luck with below code. Can anyone help me in getting with below concern. XmlDocument xmlEventData = new ...
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 ...
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
1
vote
0answers
56 views

how to add date filter web part to web page using c# code(SSOM) in sharepoint 2010?

Please guide me on how to add date filter web part to web page using SSOM
1
vote
0answers
195 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
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 ...
1
vote
0answers
85 views

SharePoint Search Queries

I am running a search for a particular query that I want to export the documents from. When I run the query I base the total count on the TotalRowsIncludingDuplicates property as I want all items ...
1
vote
0answers
48 views

Identify the Group Name for SharePoint List or document library Item in Site Collection

6 months back I had assigned the group name "Designers" to few of the list & document library items for a one of the SharePoint site Collection. Now I would like to find the items holding ...
1
vote
0answers
169 views

SP13 - Video is uploaded in Asset library programmatically, but preview image doesn't show up

I want to upload video file in asset library with SSOM. This is my code: SPFolder newFolder = videoFilesLibEN.RootFolder.SubFolders.Add("Video"); SPFile spfile = newFolder.Files.Add("VideoName....
1
vote
0answers
46 views

Get the Report of Site Collection Changes without enabling Auditing

I have come ac-crossed to annoying requirement , Where I need to get the report of changes made in site collection with out enabling "Audit" feature in SharePoint 2013 Can any one help me or guide me ...
1
vote
0answers
36 views

Unmanaged memory leak of OWSSRVR in SharePoint 2013 Windows Service

I have a Windows Service running on the SP2013 front-end server. The service uses SSOM API to access SharePoint Farm. In general, the service periodically gets some items from various site collections ...
1
vote
0answers
127 views

Extract data from ows_MetaInfo

I'm trying to extract all data from an SPListItem. Most of the data is in the ows_MetaInfo attribute in some strange format. Is there a way to either deserialize ows_MetaInfo, or get the fields in an ...
1
vote
0answers
47 views

Whether item.recycle method will trigger event receiver?

When an item.delete() methods get called it will trigger the respective item deleting and item deleted event receiver. Whether this will behave same for the item.recycle() method too.
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....
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 ...
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 ...
0
votes
0answers
155 views

Access Denied reading list with RunWithElevatedPrivileges

I am trying to read a list with a user without read permissions. I am using runWithElevatedPriviliges and I get this error: Access denied. You do not have permission to perform this action or ...
0
votes
0answers
287 views

Route documents to another site collection if approaching size limit

We'd like to have a Drop Off library look @ the current site size, and if it is approaching a limit, send the file to a different site within the site collection. It's kind of like a "you are ...