Wednesday, November 24, 2010

SQL access with integrated security from SharePoint - Code - eCraft Labs

Accessing databases using integrated security from  Sharepoint.

When creating custom webparts or other custom features in SharePoint that retrieves data from a SQL server, there are a few gotchas and pitfalls that you should be aware of. I spent a few hours battling a couple of problems, so I thought I’d document the things I found out here to spread the knowledge.

SQL access with integrated security from SharePoint - Code - eCraft Labs

Monday, November 22, 2010

Delivering Reports to a SharePoint Library

Publishing reports on a daily basis to Reporting Services is trivial with the Sharepoint delivery extension and Reporting Services.

More details:

SQL Server 2005 Reporting Services Service Pack 2 (SP2) includes a delivery extension that you can use to send a report to a SharePoint library. The delivery extension is installed and configured when you apply SP2.

To use the SharePoint delivery extension, you must create a subscription from an application page on a SharePoint site, and then select SharePoint document library as the delivery type. You cannot use the SharePoint delivery extension for subscriptions that you create in SQL Server Management Studio or Report Manager.

Delivering Reports to a SharePoint Library

Monday, November 01, 2010

Grant a Member the Right to Logon Locally

 
If you’re trying to work with Windows 2008 domain controllers, things have changed slightly (read-buried). Allowing a user to allow logon locally to the controller is a bit more complex than in 2003.

Grant a Member the Right to Logon Locally

Applies To: Windows Server 2008 R2

Domain controllers, by default, restrict the types of user accounts that have the ability to log on locally. By default, only members of the Account Operators, Administrators, Backup Operators, Print Operators, and Server Operators groups have the Allowed logon locally system right. If you want to grant a user account the ability to log on locally to a domain controller, you must either make that user a member of a group that already has the Allowed logon locally system right or grant the right to that user account.

Grant a Member the Right to Logon Locally

Wednesday, April 29, 2009

SharePoint 2007 Features - Release: 2.0 Production

 

Downloads & Files

Application Content Type Hierarchy Feature (separate download)

application, 2K, uploaded Mar 22 2007  - 2542 downloads

Application Log Viewer Feature (separate download)

application, 4K, uploaded Mar 22 2007  - 6704 downloads

Application Manage Form Users Feature (separate download)

application, 13K, uploaded Aug 31 2007  - 1936 downloads

Application Presence Contact List Feature (separate download)

application, 12K, uploaded Mar 22 2007  - 1545 downloads

Application Placeholder Master Feature (separate download)

application, 9K, uploaded Jan 8 2008  - 1226 downloads

Application Print List Feature (separate download)

application, 7K, uploaded Mar 22 2007  - 3956 downloads

Application Task Alert Feature (separate download)

application, 6K, uploaded Jan 24 2008  - 1730 downloads

Application Task Mover Feature (separate download)

application, 4K, uploaded Mar 11 2008  - 1258 downloads

Application Theme Changer Feature (separate download)

application, 4K, uploaded Mar 22 2007  - 2735 downloads

Application Debugger Feature (separate download)

application, 2K, uploaded Mar 23 2007  - 3106 downloads

Application Window Links Feature (separate download)

application, 11K, uploaded May 24 2007  - 3364 downloads

Application Debug Config Feature (separate download)

application, 8K, uploaded Aug 17 2007  - 1019 downloads

Application Manage Configuration Modifications (separate download)

application, 9K, uploaded Oct 31 2007  - 892 downloads

Application Ajax Config Feature (separate download)

application, 9K, uploaded Apr 30 2008  - 3052 downloads

Application Manage Layouts Site Map Feature (separate download)

application, 12K, uploaded Nov 2 2007  - 547 downloads

Application Minimal Master (separate download)

application, 5K, uploaded Jan 8 2008  - 880 downloads

Application Minimal Publishing Site (separate download)

application, 25K, uploaded Nov 2 2007  - 1079 downloads

Application Manage Hierarchical Object Store Feature

application, 12K, uploaded Nov 7 2007  - 492 downloads

Application Reset Theme Feature (separate download)

application, 6K, uploaded Sep 2 2008  - 615 downloads

Application Toolbar Manager (separate download)

application, 7K, uploaded Feb 27 2008  - 2847 downloads

Application Unique Column Policy Feature (separate download)

application, 16K, uploaded Mar 3 2008  - 1631 downloads

Application Global Web.Config Feature (separate download)

application, 8K, uploaded Apr 6 2008  - 788 downloads

Application 3.5 Web.Config Feature (separate download)

application, 11K, uploaded Apr 30 2008  - 1612 downloads

Application Regular Expression Validator (separate download)

application, 6K, uploaded Jun 11 2008  - 429 downloads

Application SharePoint Events Manager (separate download)

application, 12K, uploaded Jul 15 2008  - 553 downloads

Application Clean Web Part Error Feature (separate download)

application, 6K, uploaded Sep 2 2008  - 275 downloads

Application Anonymous Audience Feature (separate download)

application, 5K, uploaded Sep 22 2008  - 269 downloads

Application Variation Labels Field (separate download)

application, 15K, uploaded Sep 22 2008  - 202 downloads

Application Custom Application Configuration (separate download)

application, 6K, uploaded Dec 9 2008  - 174 downloads

Application Create Site in Content DB (separate download)

application, 11K, uploaded Dec 9 2008  - 184 downloads

Source Code Source Code for All Features

source code, 11178K, uploaded Dec 9 2008  - 2188 downloads

Documentation Documentation for All Features

documentation, 766K, uploaded Dec 9 2008  - 3305 downloads

Application All Features in a Single Download

SharePoint 2007 Features - Release: 2.0 Production

Mark Arend : Using Reflector to See SharePoint's "Source" Code

 

Do you sometimes use a "reflector" program to examine SharePoint source code? This can be necessary to:

  • Understand out how SharePoint is doing something, to find what elements can be customized.
  • Understand what members to override in classes you create that inherit from SharePoint classes.

The de facto standard program for doing this is Lutz Roeder's Reflector. The MSDN article on ten must-have tools has a great description of how helpful it can be and how to use it.

One thing the article doesn't tell you is where to find SharePoint's assemblies; fortunately it's not that hard. Click "Open" in Reflector, then with a little bit of browsing, most people easily find the dlls in the ISAPI directory of the "12-hive" (C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI).

Mark Arend : Using Reflector to See SharePoint's "Source" Code

Cum Grano Salis

 

OverGen is a tool I wrote that will take an assembly and find all methods in it that are optional and then generate overloads for all those methods that will allow the user to pass in a smaller amount of parameters. For each optional parameter a method has, an extension method will be generated.

Extension Methods are basically a very simple compiler construct that allows a class to extend another class by way of adding methods to it - the extension is very superficial - no methods are actually added to the class but rather, the compiler knows that when such a method is called on class, it will try and find it in supporting classes.

Cum Grano Salis

Notice the "this" keyword on the first parameter? That's what makes this method an extension method. If you did not have this guy, this is what ANY call to .Open would have to look like, even if you only use the first parameter:

app.Workbooks.Open("c:\\temp\\file.xlsx", Type.Missing, Type.Missing,

Type.Missing, Type.Missing, Type.Missing, Type.Missing,

Type.Missing, Type.Missing, Type.Missing, Type.Missing,

Type.Missing, Type.Missing, Type.Missing, Type.Missing);

And here's what the code looks like if you are using the extension method shown above:

app.Workbooks.Open("c:\\temp\\file.xlsx");

How to: Create a Minimal Master Page

Starting from scratch in Sharepoint, in 64 lines of code or less.

Whatever happened to <html></html>?

Creating and completing a master page to begin your SharePoint site customization takes planning and time. If you can, you want to prevent having to rewrite or back out code you don't need in your master page. This topic shows you how to create a minimal master page that includes only the minimal functionality that Office SharePoint Server 2007 requires so that you have a stable platform upon which to build your own master pages. Creating a minimal master page can help you avoid the time-consuming process of backing code out of a pre-existing .master page such as BlueBand.master, or removing functionality and then building it back in when your customization needs change again.

How to: Create a Minimal Master Page

The actual page code for your “minimal” template below.

 

<%-- Identifies this page as a .master page written in Microsoft Visual C# and registers tag prefixes, namespaces, assemblies, and controls. --%>
<%@ Master language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register Tagprefix="SPSWC" Namespace="Microsoft.SharePoint.Portal.WebControls" Assembly="Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="PublishingNavigation" Namespace="Microsoft.SharePoint.Publishing.Navigation" Assembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="wssuc" TagName="Welcome" src="~/_controltemplates/Welcome.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="DesignModeConsole" src="~/_controltemplates/DesignModeConsole.ascx" %>
<%@ Register TagPrefix="PublishingVariations" TagName="VariationsLabelMenu" src="~/_controltemplates/VariationsLabelMenu.ascx" %>
<%@ Register Tagprefix="PublishingConsole" TagName="Console" src="~/_controltemplates/PublishingConsole.ascx" %>
<%@ Register TagPrefix="PublishingSiteAction" TagName="SiteActionMenu" src="~/_controltemplates/PublishingActionMenu.ascx" %>
<%-- Uses the Microsoft Office namespace and schema. --%>
<html>
  <WebPartPages:SPWebPartManager runat="server"/>
  <SharePoint:RobotsMetaTag runat="server"/>

  <%-- The head section includes a content placeholder for the page title and links to CSS and ECMAScript (JScript, JavaScript) files that run on the server. --%>
  <head runat="server">
    <asp:ContentPlaceHolder runat="server" id="head">
      <title>
        <asp:ContentPlaceHolder id="PlaceHolderPageTitle" runat="server" />
      </title>
    </asp:ContentPlaceHolder>
    <Sharepoint:CssLink runat="server"/>
    <asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server" />
  </head>
  <%-- When loading the body of the .master page, SharePoint Server 2007 also loads the SpBodyOnLoadWrapper class. This class handles .js calls for the master page. --%>
  <body onload="javascript:_spBodyOnLoadWrapper();">
    <%-- The SPWebPartManager manages all of the Web part controls, functionality, and events that occur on a Web page. --%>
    <form runat="server" onsubmit="return _spFormOnSubmitWrapper();">
      <wssuc:Welcome id="explitLogout" runat="server"/>
      <PublishingSiteAction:SiteActionMenu runat="server"/> 
      <PublishingWebControls:AuthoringContainer id="authoringcontrols" runat="server">
        <PublishingConsole:Console runat="server" />
      </PublishingWebControls:AuthoringContainer>
      <%-- The PlaceHolderMain content placeholder defines where to place the page content for all the content from the page layout. The page layout can overwrite any content placeholder from the master page. Example: The PlaceHolderLeftNavBar can overwrite the left navigation bar. --%>
      <asp:ContentPlaceHolder id="PlaceHolderMain" runat="server" />
        <asp:Panel visible="false" runat="server">
        <%-- These ContentPlaceHolders ensure all default SharePoint Server pages render with this master page. If the system master page is set to any default master page, the only content placeholders required are those that are overridden by your page layouts. --%>
<asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server"/>
<asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server"/>
<asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea"  runat="server"/>
<asp:ContentPlaceHolder id="PlaceHolderLeftNavBar" runat="server"/>
<asp:ContentPlaceHolder ID="PlaceHolderPageImage" runat="server"/>
<asp:ContentPlaceHolder ID="PlaceHolderBodyLeftBorder" runat="server"/>
<asp:ContentPlaceHolder ID="PlaceHolderNavSpacer" runat="server"/>
<asp:ContentPlaceHolder ID="PlaceHolderTitleLeftBorder" runat="server"/>
<asp:ContentPlaceHolder ID="PlaceHolderTitleAreaSeparator" runat="server"/>
<asp:ContentPlaceHolder ID="PlaceHolderMiniConsole" runat="server"/>
<asp:ContentPlaceHolder id="PlaceHolderCalendarNavigator" runat ="server" />
<asp:ContentPlaceHolder id="PlaceHolderLeftActions" runat ="server"/>
<asp:ContentPlaceHolder id="PlaceHolderPageDescription" runat ="server"/>
<asp:ContentPlaceHolder id="PlaceHolderBodyAreaClass" runat ="server"/>
<asp:ContentPlaceHolder id="PlaceHolderTitleAreaClass" runat ="server"/>
<asp:ContentPlaceHolder id="PlaceHolderBodyRightMargin" runat="server" />
</asp:Panel>
    </form>
  </body>
</html>

Thursday, July 17, 2008

About controlling access to sites and site content - SharePoint Server - Microsoft Office Online

Had to do some Sharepoint security troubleshooting today…. this article is a good recap of the security model in Sharepoint. 

As a site owner, when you create the permission structure for your site or grouping of sites, you should balance ease of administration with the need to control specific permissions for individual securable objects. With any Web site, it is also important to follow the principle of least privilege when authorizing access to the site.

About controlling access to sites and site content - SharePoint Server - Microsoft Office Online

Monday, September 17, 2007

Planning and architecture for Office SharePoint Server 2007

For some reason this would scare me away from deploying a Sharepoint Site.   Information Overload!

Actually it gets worse.... with over 40 planning worksheets.

They're not all that bad - most are one-pagers- though a wizard interface or maybe an Access application would be a good start.  Or perhaps integrating this into the product itself?  What ever happened to the evolving model of a self-maintained, self-documented wiki?  Perhaps this would be too chaotic with the Sharepoint model...

Anyway, the first step is to plan... and there's lots of materials available:

Downloadable book: Planning and architecture for Office SharePoint Server 2007

Planning worksheets for Office SharePoint Server 2007

Plan overall design

Plan Web site structure and publishing (Office SharePoint Server)

Plan for personalized content and sites

Plan workflows

Plan InfoPath Forms Services

Plan for business intelligence

Plan search (Office SharePoint Server)

Plan communication (Office SharePoint Server)

Plan document management

Plan records management

Plan site and content security (Office SharePoint Server)

Plan for site creation and maintenance (Office SharePoint Server)

Plan for system requirements

Design server farms and topologies (Office SharePoint Server)

Design logical architecture

Plan for authentication (Office SharePoint Server)

Plan for and design security (Office SharePoint Server)

Plan for performance and capacity (Office SharePoint Server)

Plan for and design database storage and management

Link to Planning and architecture for Office SharePoint Server 2007

Before You Begin with SharePoint Server 2007

Lots of useful articles and templates here. 

Certification

We strongly encourage passing of our new certifications as a proven way to validate that you have the prerequisite skills and knowledge to implement and manage SharePoint solutions.

Source: Before You Begin with SharePoint Server 2007

More on 70-541 from Nadeem's Blog

 

TS Exam 70-541: WSS 3.0 - Application Development

I took this exam on Friday and I want to share the following with anyone who is interested in taking it:

  1. For a limited time (while it's still in beta), you can take the exam for free using promotion code BTA541.  You save $125 (and you don't have to deal with your company's beloved expense-tracking and reimbursement system).  Register at www.prometric.com.
  2. Don't bother looking for practice exams or Microsoft e-Learning courses that will help you prepare for this.  There isn't anything as far as I can see.
  3. Ishai Sagi has a blog post with some tips for this exam and the MOSS equivalent (70-542).  I also need to thank Ishai for posting the promo code.
  4. Don't rush.  There's more than enough time to think about each question thoroughly.
  5. There seemed to be a lot of questions on Records Management, which I wasn't expecting because that's more of a MOSS thing.  But I guess it integrates with WSS-only spaces, so they saw it as fair game.  On the other hand, I didn't notice there being a lot of questions on custom field types like Ishai mentioned.
  6. It looked to me as though the exam is in beta for some good reasons.  I am very sure I saw questions where the only sensible answer had a typo or two in the code.  And I suppose I could be wrong but I swear I looked at some answer choices line by line and couldn't notice any difference except a variable name.  For example, in at least one case it looked as though the only difference in the choices was a change from the word "site" to "web" but only in the variable name (they probably meant to change the object type too but missed that).  So if the exact same code appears in two different choices for the answer, what if I wanted to pick that code.. which one do I choose?

I found that when writing this exam, the following (which is true in general) is especially true in this case: You can often see to it that you probably get the right answer even if you get to a question where you've never seen the code before.  Maybe a question is asking about a certain part of the SharePoint object model that you have never encountered in your work, or whatever may be the case.  You really cannot (or at least you should not) be completely prepared for any possible code question.  It would be a huge, wasted effort if you memorized all aspects of the SharePoint OM and CAML syntax.

So what do you do? Answer what you can where you know your stuff, and then note the following to help you with the rest:

  • Sometimes the code in a multiple choice answer selection simply doesn't make sense.  You have to realize that code is not something magical that happens to do what you want as long as it's written in a certain way.  When you code, you are providing instructions to something that can't read your mind and doesn't know what you want to do.  So in your code you have to be explicit about the things you intend to do and what exactly it is that you're doing these things on.  So if the code doesn't, in some way, incorporate an instruction or piece of information that anything or anyone would need in order to do the right task on the right thing, it couldn't possibly be correct.  I hope this is clear.
  • It may not hurt to be a little subjective about the code that is presented to you as possible answers to a question.  Ask yourself things like:
    • "If I was Microsoft (or VTI, I suppose) and I created this object model, would I really expose this method on this object with these parameters in this way?".
    • "Is this good code?" (of course, it doesn't have to be in order to be the right answer...  But read the following.)
  • If a possible answer to a question is built on an object model or markup language syntax that really deviates from standard best practices (like using enums, following the OOP paradigm, etc) then it's possibly more likely to be a wrong answer.  I find that "embarassing" examples of a programming model or syntax are usually conspicuously absent from SDK documentation, learning material and other publications that a company puts out.  It's usually us bloggers that find and expose these sorts of things.
  • You don't need to get every answer right.  So don't worry about it and move onto the next one.

Now it's time for the MOSS exam.  This one's going to be tough...

Source: Home - Nadeem's Blog

Monday, May 08, 2006

Berkshire Hathaway Meeting - Bill Gates Bows out from being first shoemoney show guest (politely) : Shoemoney Marketing Thoughts

Berkshire Hathaway Meeting - Bill Gates Bows out from being first shoemoney show guest (politely) : Shoemoney Marketing Thoughts: "I ran into Bill Gates for the 2nd year in a row and like a IDIOT I did not have my camera. I talked to him for a few minutes about Adcenter and he said that Microsoft was REALLY excited about this product and to look for them to make some big moves in the search engine market. I also thanked him for hosting me at fenway park 2 weeks ago in Boston. (the thanks really belogs to Jen and todd for hooking that up)."

Thursday, January 27, 2005

Sharepoint Query Builder Tool

A valuable tool for building and testing queries against Microsoft Office SharePoint Portal Server 2003. This tool has a Windows interface that lets you connect to a portal and will gather all of a) the properties of crawled documents, b) content indexes and c) source groups. You can then simply point and click to select the items and criteria you want to use for your query, then execute. The search is sent to the SharePoint Query web service and the resultant XML is displayed in an easy to work with interface.
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=fe3d7179-c107-45cf-bd3c-893d2cbb68c5

Wednesday, January 26, 2005

SharePoint Portal Server Usage Details

SharePoint Portal Server Usage Details
Want to know who is using your SharePoint Portal Server 2003? You can find out pretty easily. A coworker of mine discovered this in an article. You can reveal usage details in portal areas by appending the following to the URL _layouts/1033/UsageDetails.aspx
For Example:
http://[PortalName]/[PortalArea]/_layouts/1033/UsageDetails.aspx
Thanks to Azwan Muhammad

SPS & Web Services

SharePoint and Web ServicesBy Mike Gunderloy
http://www.developer.com/tech/article.php/3104621
In my last article, I showed you how to work with Windows SharePoint Services from within Microsoft Office 2003. But what if you're using something other than Office 2003 as as development environment, and want to tap into SharePoint data? No problem! In this article, I'll give you a quick overview of the Web services interface to SharePoint.
The SharePoint Web Services
Windows SharePoint Services was being designed and developed during the time when Microsoft was beginning to heavily push Web services. It should be no surprise, then, to find out that you can get at the data in SharePoint through Web services. In fact, there's not just one Web service involved; there are 16. Here's a brief rundown of the Web services that a SharePoint server makes available out of the box:
http://server:5966/_vti_adm/Admin.asmx - Administrative methods such as creating and deleting sites
http://server/_vti_bin/Alerts.asmx - Methods for working with alerts
http://server/_vti_bin/DspSts.asmx - Methods for retrieving schemas and data
http://server/_vti_bin/DWS.asmx - Methods for working with Document Workspaces
http://server/_vti_bin/Forms.asmx - Methods for working with user interface forms
http://server/_vti_bin/Imaging.asmx - Methods for working with picture libraries
http://server/_vti_bin/Lists.asmx - Methods for working with lists
http://server/_vti_bin/Meetings.asmx - Methods for working with Meeting Workspaces
http://server/_vti_bin/Permissions.asmx - Methods for working with SharePoint Services security
http://server/_vti_bin/SiteData.asmx - Methods used by Windows SharePoint Portal Server
http://server/_vti_bin/Sites.asmx - Contains a single method to retrieve site templates
http://server/_vti_bin/UserGroup.asmx - Methods for working with users and groups
http://server/_vti_bin/versions.asmx - Methods for working with file versions
http://server/_vti_bin/Views.asmx - Methods for working with views of lists
http://server/_vti_bin/WebPartPages.asmx - Methods for working with Web Parts
http://server/_vti_bin/Webs.asmx - Methods for working with sites and subsites
To use any of these Web services, replace server with the name of your SharePoint server. Because they're implemented using ASP.NET code, you can retrieve the matching WSDL file for any service by appending ?WSDL to the end of the URL. When you do so, you'll discover that each one supports multiple methods, making this one of the richest sets of Web services of any current product. For full information on the available Web methods, download the SharePoint Products and Technologies 2003 SDK.