All things Sharepoint

How to find a SharePoint webpart name from the ID or GUID?

SELECT DISTINCT D.SiteID, D.WebId, W.FullURL as WebURL, D.Id As DocumentId,                  D.DirName, D.LeafName, tp_ID As WebPartSK  FROM       dbo.Docs D WITH (nolock)   INNER JOIN dbo.Webs W WITH (nolock) ON D.WebID = W.Id  INNER JOIN dbo.WebParts WP WITH (nolock) ON D.Id = WP.tp_PageUrlID  WHERE WP.tp_ListId Is Null AND WP.tp_Type Is Null AND WP.tp_Flags Is Null        AND WP.tp_BaseViewID Is Null AND WP.tp_DisplayName Is Null         AND WP.tp_Version Is Null  AND WP.tp_WebPartTypeId='<your web parts id>'  Source for this query is Ryan's comment her: http://stackoverflow.com/questions/1498409/sharepoint-find-where-webpart-is-in-use    

By |2012-06-28T16:35:19+00:00June 28th, 2012|Sharepoint on Premise|3 Comments

Installing Adobe 9 IFilter x64 for SharePoint 2010

Ran into some issues after running through the install: http://support.microsoft.com/kb/2293357 Search would still not pick up the content of the pdf, just the title. Had to add this registry key and start a full crawl and it worked: • Using Regedit on the server, navigate to \HKEY_LOCAL_MACHINESOFTWAREMicrosoftOffice Server14.0SearchSetupFilters • Right-click the Filters folder and select New Key. Enter “.pdf” for the key value. • Add the following values to this key: Default = Extension = pdf FileTypeBucket = 1 MimeTypes = application/pdf

By |2022-12-11T19:44:49+00:00May 8th, 2012|Sharepoint on Premise|0 Comments

SharePoint Limits

These are some limits found in the 2007 version of SharePoint, specifically Windows SharePoint Services 3.0.   Site object Guidelines for acceptable performance Notes Scope of impact when performance degrades Site collection 50,000 per content database Total farm throughput degrades as the number of site collections increases. Farm Site collection 150,000 per Web application This limit is theoretical, and is dependent largely upon: Performance of the database server on which the configuration database resides. Performance of the Web servers in the farm. Network bandwidth between the Web servers and the database server. This is not a hard limit, and assumes a single database server. Your environment may not be able to host this many site collections per Web application. Distributing content databases across additional database servers can increase the effective limit of the number of site collections per Web application. You should perform testing to determine the actual effective limit [...]

By |2022-12-11T19:44:49+00:00March 26th, 2012|Sharepoint on Premise|0 Comments

SharePoint AuditData table is too large- Powershell script to schedule STSADM -o TrimAuditLog

If you have turned on Audit logging in SharePoint 2007, you will wake up some day with a nasty surprise of a bloated SQL server database.  The data is all being stored in the AuditData table in the content database. Luckily, there is an STSADM command for this, "stsadm -o trimauditlog" After some research, the general consensus is to not truncate the table directly, although no specific reason is ever given except "Not Supported." As I always prefer to use a standard API, I found that you must do this command in very small chunks or else you could lock up your SQL server and effectively crash your SharePoint installation (found out the hard way). I found 800,000 records to take approximately 15 minutes on a 2 Web Front end 1 Index Server, SQL Cluster type SharePoint farm.  To be safe, I wrote a PowerShell script to take care of [...]

By |2022-12-11T19:44:49+00:00February 1st, 2012|Sharepoint on Premise|1 Comment

Pull users and groups from a SP list that allows multiple users and groups. This is a follow up post from a previous post : http://surfpointtech.com/2011/09/12/how-to-pull-the-email-addresses-from-a-sharepoint-user-field-allow-multiple-users/ When examining a User field on a SharePoint list, you need to see whether the list setting allows for multiple users as well as both Users and Groups. The key to pulling both the groups and the users is to be able to test for a group as opposed to a user object.  In this case, I found that the fieldUser.User object is null for groups, but not for Users.  So, as you iterate through the fieldUser objects in the SPFieldUserValueCollection, you'll find a group when the fieldUser is not null, but the fieldUser.User object is null.  That way, you know you have a SPGroup at that point, and can loop through the users in the group. After that, you do the normal adding [...]

By |2012-01-31T23:42:51+00:00January 31st, 2012|Sharepoint on Premise|0 Comments

SharePoint Error in Visual Studio Debugging a workflow: Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))

Leave it to Microsoft to break every SharePoint Dev server in the world in one fell swoop. When you go to debug a workflow from Visual Studio 2008, it builds fine, but on deploy, it fails while trying to attach to the list with this error: Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT)) Causing the Error: Security patch KB2493987 If you have automatic updates set on your dev servers (which many people do), you will automatically get this security patch.  And, it will break all your custom visual studio debugging abilities on all dev servers. Solution: = Running the SharePoint Products and Technologies Configuration Wizard and doing an IISRESET. For a full explanation, see this helpful post: http://deinfotech.blogspot.com/2011/09/sharepoint-2007errors-creating-site-and.html

By |2022-12-11T19:44:49+00:00October 25th, 2011|Sharepoint on Premise, Uncategorized|0 Comments

How to add directly to the Workflow History from a custom SharePoint workflow

This one was a little hard to track down. How do you write directly to the SharePoint workflow history? It's easy enough to add a LogToHistory activity and set the HistoryDescription and HistoryOutcome, but what if you want to create those entries dynamically? After toying around with different ways of trying this, the answer was pretty easy: Here's the code sample: SPMember usermember = workflowProperties.OriginatorUser; SPWorkflow.CreateHistoryEvent(this.workflowProperties.List.ParentWeb, this.workflowId, 0, usermember, TimeSpan.MinValue, "Corp Legal Reviewed", "Status Change", string.Empty);

By |2011-09-12T03:29:28+00:00September 12th, 2011|Sharepoint on Premise|7 Comments

How to pull the email addresses from a SharePoint User field (allow multiple users)

To pull the user information, you first have to convert the field into a SPFieldUser object, and then create a collection of the SPFieldUserValueCollection. Then, loop through the collection and pull the Email property of the SPFieldUserValue. code sample: ---------------------------------------------------------------------- string sFieldNameTo = "BU Legal To Email"; string sFieldNameCC = "BU Legal CC Email"; //Add To and CC based on multiple user field if (workflowProperties.Item[sFieldNameTo] != null) { SPFieldUser UsersColumn = (SPFieldUser)workflowProperties.Item.Fields.GetField(sFieldNameTo); SPFieldUserValueCollection Users = (SPFieldUserValueCollection)UsersColumn.GetFieldValue(workflowProperties.Item[sFieldNameTo].ToString()); foreach (SPFieldUserValue fieldUser in Users) { if (fieldUser.User.Email != null && fieldUser.User.Email != string.Empty) { mail.To.Add(fieldUser.User.Email); }// }// }// if (workflowProperties.Item[sFieldNameCC] != null) { SPFieldUser UsersColumn = (SPFieldUser)workflowProperties.Item.Fields.GetField(sFieldNameCC); SPFieldUserValueCollection Users = (SPFieldUserValueCollection)UsersColumn.GetFieldValue(workflowProperties.Item[sFieldNameCC].ToString()); foreach (SPFieldUserValue fieldUser in Users) { if (fieldUser.User.Email != null && fieldUser.User.Email != string.Empty) { mail.CC.Add(fieldUser.User.Email); }// }// }//   Updated 5/11/16 For CSOM use this: foreach (FieldUserValue userValue in item["MultiUser"]as FieldUserValue[]) { }//    

By |2016-05-11T23:05:17+00:00September 12th, 2011|Sharepoint on Premise|1 Comment

Adding MyLinks Programattically in C#

Had a recent issue after migrating our users from one domain to another.  Their MyLinks did not come over after running stsadm migrateuser.  Found the links in the database and wrote a quick winforms app to move them over.  Permissions need to be allowed in Central Admin, Shared Services,  personalization services as well as site col admin on SSP. Here's how to populate them: Extract the MyLinks information from the database Create a Winforms App Add a web reference to the webservice Concatenate the extracted data into a comma separated list in excel Run the app 1.  In SQL, join the UserLinks table in the SSP database with the UserProfile_Full table to get a list of links: SELECT     UP.NTName, UP.PreferredName, UP.Email, UL.Id, UL.RecordId, UL.Title, UL.GroupType, UL.GroupTitle, UL.Url, UL.ContentClass, UL.PolicyId, UL.ItemSecurity FROM         UserLinks AS UL INNER JOIN                       UserProfile_Full AS UP ON UL.RecordId = UP.RecordID domainjsmith  Home  http://site/Pages/Default.aspx General  1  domainjsmith  Yahoo  [...]

By |2022-12-11T19:44:49+00:00June 22nd, 2011|Sharepoint on Premise|0 Comments

Querying Sharepoint List Item Versions using SQL

The request was simple enough, get the total number of days for a status change from one custom list field to another custom list field  in a Sharepoint List Item. There's a few ways to do this. Assume you have a Sharepoint workflow that changes a list item through various statuses and various fields. A simple way is to create a Date Changed field for each field that you want to track, then to populate it in your workflow as it goes along. If you don't have date fields set up in your list, you can take advantage of the version history if version history is turned on. The key here is to loop through your list items, know which field is the field you want, and then take the first version where the value has changed to the desired value. For example, if you are waiting for a "Status" [...]

By |2022-12-11T19:44:49+00:00April 26th, 2011|Sharepoint on Premise|10 Comments
Go to Top